-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Fix error handling for exceptions on values parsing. #3574
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
base: master
Are you sure you want to change the base?
Fix error handling for exceptions on values parsing. #3574
Conversation
- Fix: Avoid connection leaks by ensuring parse closure on error. - Refactor: Move `Writer` instantiation to improve isolation and prevent state reuse issues.
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.
Please add tests if possible. (Ideally, point out the minimal fix for each bug and which changes are just cleanup, e.g. by separating into 2–3 commits, but the tests will help make that more clear anyway.)
|
I would really appreciate to get a feedback first, that those changes are in right direction. Those two changes are tight together as they both are related to serialization issue. Just because I solved global writer issue first, zombie client appeared next in PgPool, because without fixing writers you just write sync/close in next query I'm not an expert of pg protocol and just investigated this issue few hours. |
|
Yes, these changes make sense. The shared writer was probably an attempt at improving performance. |
If this is something which can be acomplished without reinstantiating the writer I would greatly prefer it. This is extremely hot path code. Is there a way to fix this w/o? Also: needs tests before merging. Thanks for the eyes on this tho! I'll leave it open for a bit as it might be something I can quickly fix (IF there is a repoducable test case on how to trigger the issue) |
|
Sorry, I missed these comments, my bad. I'll try to take a look on this back in a next few weeks (split to different commits, adding tests) Re
I think it should be doable without reinstantiating the writer, however the fix will be fragile then for any future changes. Also code will be a bit ugly (each time when you have some error you should not forget to clean it properly). I'll try to play around it and come back with something |
Fixes #3573
Writerinstantiation to improve isolation and prevent state reuse issues.