I've got an nginx 1.10.3 server running on Debian Stretch. One of the sites it serves is a WebDAV share that is read and written by a desktop app. The app performs the following steps when a file named
myfile is saved to the WebDAV server:
PUT /myfile.tmp, body contains new file data
The client app compares the response from step 5 to the data sent in step 2, and if the file data does not match an error is raised. These steps happen extremely rapidly on our particular network (the server and client are geographically close, connected to the same Ethernet switch) -- my testing with tcpdump suggests the entire conversation finishes within 45 ms.
The problem is, the data returned in step 5 doesn't immediately match what the client sent in step 2. The data being returned is the previous version of
myfile, before the
MOVE steps replaced it. If I were to go back and repeat step 5 manually a moment later, the file data would be the new version as expected.
I know the client waits for each response to arrive before issuing a subsequent request. My best guess is that different requests are hitting different nginx workers/threads, or maybe there is some kind of cache invalidation or flush that isn't happening fast enough.
How can I fix this behavior without modifying the client app or artificially slowing down the requests?
Full nginx.conf and site config follows:
EDIT: An interesting observation I discovered. If I reload nginx (
sudo service nginx reload), the very first attempt to save the file succeeds. But if I try to save it a subsequent time, the same error happens.