- Notifications
You must be signed in to change notification settings - Fork 232
Catch and log any exceptions while closing the transport #838
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
Conversation
Previously these would show up as big tracebacks in the logs which was ugly, considering all sorts of things can go wrong when suddenly closing the transport (such as when a celery worker terminates) Fixes elastic#823
💔 Tests FailedExpand to view the summary
Build stats
Test stats 🧪
Test errorsExpand to view the tests failures
Log outputExpand to view the last 100 lines of log output
|
I don't know how this happened, I think black added it? But then it didn't re-add it this time when I removed it. Probably more of black's magic comma stuff that has been added recently
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
self.queue("close", None) | ||
if not self._flushed.wait(timeout=self._max_flush_time): | ||
raise ValueError("close timed out") | ||
logger.error("Closing the transport connection timed out.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we additionally also should use a shorter timeout than max_flush_time
. Maybe 2s?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm. I can potentially see the reasoning, but let's assume the user has upped the api_request_time
because they're on a slow network (or for some other reason). I don't particularly want to lose data due to being impatient at close time.
I think I'm going to leave it, unless you think there's a hole in my reasoning?
More flakey tests. Merging. |
* Catch and log any exceptions while closing the transport Previously these would show up as big tracebacks in the logs which was ugly, considering all sorts of things can go wrong when suddenly closing the transport (such as when a celery worker terminates) Fixes elastic#823 * Remove trailing comma I don't know how this happened, I think black added it? But then it didn't re-add it this time when I removed it. Probably more of black's magic comma stuff that has been added recently * Add to changelog
* Catch and log any exceptions while closing the transport Previously these would show up as big tracebacks in the logs which was ugly, considering all sorts of things can go wrong when suddenly closing the transport (such as when a celery worker terminates) Fixes elastic#823 * Remove trailing comma I don't know how this happened, I think black added it? But then it didn't re-add it this time when I removed it. Probably more of black's magic comma stuff that has been added recently * Add to changelog
* Catch and log any exceptions while closing the transport Previously these would show up as big tracebacks in the logs which was ugly, considering all sorts of things can go wrong when suddenly closing the transport (such as when a celery worker terminates) Fixes elastic#823 * Remove trailing comma I don't know how this happened, I think black added it? But then it didn't re-add it this time when I removed it. Probably more of black's magic comma stuff that has been added recently * Add to changelog
Previously these would show up as big tracebacks in the logs which
were ugly, considering all sorts of things can go wrong when suddenly
closing the transport (such as when a celery worker terminates)
Fixes #823