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

Move grid file retrieval code up into (retried) init code #61

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

rdkls
Copy link

@rdkls rdkls commented May 5, 2014

It the mongo server restarts after nginx has started, nginx-gridfs then has a stale socket.
This wasn't getting picked up in the handler's initial code to check connection, and would fail later at "gridfs_find_query" time, returning 404.

This commit moves the "gridfs_find_query" call into the handler's initial gridfs_init loop, which is retried (by default) once if it initially fails.
The result is that if the mongo server restarts, nginx no longer has to be restarted to clear the stale handler; the failure of the find request triggers the "ngx_http_mongo_reconnect" call, then the subsequent call is successful (unless there actually is something wrong)

root and others added 2 commits May 5, 2014 03:23
… socket becomes invalid (e.g. happens when mongodb server restart) - we try reconnecting MONGO_MAX_RETRIES_PER_REQUEST times (default 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant