Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make curl invocations reliable #96

Closed
syedriko opened this issue Mar 31, 2019 · 6 comments
Closed

Make curl invocations reliable #96

syedriko opened this issue Mar 31, 2019 · 6 comments
Labels
demo-src Any issues related to demo sources, its commands etc.,

Comments

@syedriko
Copy link
Contributor

Describe the bug
In Build Template
curl -H "Host: event-greeter.knativetutorial.example.com" $IP_ADDRESS
-H "Content-Type: application/json"
-d '{"message": "test message"}'
The above command produces no output and returns 0 for an exit code. A repeated invocation works fine and produces the expected result. It seems like a timeout on the curl part due to the target pod taking its time to spin up.

To Reproduce
Run the curl command in the Build Template chapter of the tutorial.

Expected behavior
curl makes a successful invocation every time.

Desktop (please complete the following information):

  • OS: Fedora 29
@kameshsampath kameshsampath added the demo-src Any issues related to demo sources, its commands etc., label Apr 1, 2019
@kameshsampath kameshsampath added this to the Quarkus milestone Apr 1, 2019
@kameshsampath
Copy link
Contributor

the services does have liveliness and readiness probes add to avoid this empty result or HTTP 502. but i will be soon moving examples to use Quarkus so we should see faster boot up.

@markusthoemmes - any thoughts ?

@markusthoemmes
Copy link
Contributor

It'd be interesting to know what response codes are returned. @syedriko could you add the -v flag to your curl command to get that?

You might see 404s briefly after your service becomes ready which equates to Istio's propagation delay. We've got an item to fix that on our backlog, although it's not high prio atm and there's also no plan as to how to fix it currently.

@syedriko
Copy link
Contributor Author

syedriko commented Apr 1, 2019

Here you go:

  • without -v
[syedriko@localhost knative]$ curl -H "Host: event-greeter.knativetutorial.example.com" $IP_ADDRESS -H "Content-Type: application/json" -d '{"message": "test message"}'
[syedriko@localhost knative]$ echo $?
0
[syedriko@localhost knative]$
  • with -v
[syedriko@localhost knative]$ curl -v -H "Host: event-greeter.knativetutorial.example.com" $IP_ADDRESS -H "Content-Type: application/json" -d '{"message": "test message"}'
* Rebuilt URL to: 192.168.39.2:31380/
*   Trying 192.168.39.2...
* TCP_NODELAY set
* Connected to 192.168.39.2 (192.168.39.2) port 31380 (#0)
> POST / HTTP/1.1
> Host: event-greeter.knativetutorial.example.com
> User-Agent: curl/7.61.1
> Accept: */*
> Content-Type: application/json
> Content-Length: 27
> 
* upload completely sent off: 27 out of 27 bytes
< HTTP/1.1 404 Not Found
< location: http://event-greeter.knativetutorial.example.com/
< date: Mon, 01 Apr 2019 21:23:38 GMT
< server: envoy
< connection: close
< content-length: 0
< 
* Closing connection 0
[syedriko@localhost knative]$ echo $?
0
[syedriko@localhost knative]$ 

Now thinking about it, may be running curl with -v is the way to go. It makes it clear what's going on instead of just exiting silently and we can explain in the tutorial that it's normal to see 404s for a while (is it?) but that the invocation will eventually succeed.

@markusthoemmes
Copy link
Contributor

@syedriko yes, for now the 404s are "works as intended" (they are also retried by upstream's e2e tests). knative/serving#3312 captures the requirement.

@kameshsampath kameshsampath removed this from the Quarkus milestone Apr 16, 2019
@kameshsampath
Copy link
Contributor

@syedriko - if this expected behaviour then shall we close this bug?

@syedriko
Copy link
Contributor Author

I suppose we can, as long as we explain in the text that a curl invocation can produce no output and the student may need to repeat it until it succeeds?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
demo-src Any issues related to demo sources, its commands etc.,
Projects
None yet
Development

No branches or pull requests

3 participants