Earlier quoted context omitted.
The first sequence ends with foo/bar existing. The second one ends with it not existing. I'd say that anybody that sends a pair of PUT/DELETE requests in fast succession over the web and expects a stable result is a fool. This should have no effect on practice, because nobody should be relying on the ordering anyway.
Ah, my mistake. I had always equated PUT with updating and assumed it should fail if it doesn't find the resource. Big oversight!
Nginx reverse proxies retries PUT/POST/DELETE on response timeout by default
51–60 of 96 posts
Re: Nginx reverse proxies retries PUT/POST/DELETE on response timeout by default
#52This essentially became the laser of death the other day and lead to cascading failure which eventually brought down our system. That's why I'm posting this. Very few people know about this and it's really scary. I'm happy people are voting this up to increase some awareness of this. Potential workarounds: You might think disabling `proxy_next_upstream timeout` will do, but that will also disable connection timeout r…
"but that will also disable connection timeout retry which is not what you want!" Why is this not what you want? Are you using the reverse proxy as a load balancer to multiple servers? Otherwise, if it's 1:1 proxy (for something like SSL termination) wouldn't having nginx fail/timeout when the server does be acceptable?
Re: Nginx reverse proxies retries PUT/POST/DELETE on response timeout by default
#53Re: Nginx reverse proxies retries PUT/POST/DELETE on response timeout by default
#54Earlier quoted context omitted.
We've hit 3 problems with nginx: 1. Exactly this, we had mystery double trades from our clients and it took us a long time to realise it was nginx assuming we timed out and routing traffic to the next server 2. It doesn't do health checks. When a server goes down it will send 1 out of every 8 real requests to the down server to see if it responds. Having disabled resubmitting of requests to avoid the double trade iss…
Nginx can also be used for other protocols, see stream block.
Re: Nginx reverse proxies retries PUT/POST/DELETE on response timeout by default
#55This essentially became the laser of death the other day and lead to cascading failure which eventually brought down our system. That's why I'm posting this. Very few people know about this and it's really scary. I'm happy people are voting this up to increase some awareness of this. Potential workarounds: You might think disabling `proxy_next_upstream timeout` will do, but that will also disable connection timeout r…
We've hit 3 problems with nginx: 1. Exactly this, we had mystery double trades from our clients and it took us a long time to realise it was nginx assuming we timed out and routing traffic to the next server 2. It doesn't do health checks. When a server goes down it will send 1 out of every 8 real requests to the down server to see if it responds. Having disabled resubmitting of requests to avoid the double trade iss…
Re: Nginx reverse proxies retries PUT/POST/DELETE on response timeout by default
#56This essentially became the laser of death the other day and lead to cascading failure which eventually brought down our system. That's why I'm posting this. Very few people know about this and it's really scary. I'm happy people are voting this up to increase some awareness of this. Potential workarounds: You might think disabling `proxy_next_upstream timeout` will do, but that will also disable connection timeout r…
Re: Nginx reverse proxies retries PUT/POST/DELETE on response timeout by default
#57This behavior is non-compliant[1] with the RFC. Although (from the standpoint of the RFC), everything on the server side (including nginx itself) is considered the web application, nginx probably takes the implicit position that dealing with multiple requests on non-idempotent methods such as POST is really a problem that the proxied web app itself should cope with. But then nginx puts the web app in an untenable pos…
A pretty good overview of reverse proxies can be found in [1]... spoiler: nginx is NOT one of the best-of-breed. Compliance was/is indeed an issue. 1. http://www.slideshare.net/bryan_call/choosing-a-proxy-server...
Re: Nginx reverse proxies retries PUT/POST/DELETE on response timeout by default
#58Earlier quoted context omitted.
There could be races between PUT/DELETE. There is no grantee how the retry was made.
This is why the If-Match and If-None-Match preconditions exist; they resolve PUT races by checking that the resource is in the expected state.
Re: Nginx reverse proxies retries PUT/POST/DELETE on response timeout by default
#59Re: Nginx reverse proxies retries PUT/POST/DELETE on response timeout by default
#60Earlier quoted context omitted.
Ah, my mistake. I had always equated PUT with updating and assumed it should fail if it doesn't find the resource. Big oversight!
I think you're correct, actually. If you want to create a new object, it should be a POST. In a well designed RESTful service, a PUT on an object that doesn't exist should fail, and both of the PUT/DELETE orderings above should result in the same state of the world: the object does not exist.
>>The PUT method requests that the enclosed entity be stored under the supplied Request-URI. If the Request-URI refers to an already existing resource, the enclosed entity SHOULD be considered as a modified version of the one residing on the origin server. If the Request-URI does not point to an existing resource, and that URI is capable of being defined as a new resource by the requesting user agent, the origin server can create the resource with that URI
[1] https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html 9.6