fix: PGPool error handling and app.js catch/callback bugs#111
Open
arnoldcastro5000 wants to merge 1 commit into
Open
fix: PGPool error handling and app.js catch/callback bugs#111arnoldcastro5000 wants to merge 1 commit into
arnoldcastro5000 wants to merge 1 commit into
Conversation
Author
|
@dadiorchen for your review. Fixes Bug 1 in issue: Greenstand/treetracker-infrastructure#315 |
Author
|
The 2 stuck pods need to be cleared separately. They are not handled by this PR. PS D:\git\node-mapnik-1> kubectl get pods -n tile-server |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fixes four confirmed bugs in
PGPool.jsandapp.jsthat causepermanent request freezes, memory leaks, unhandled process crashes,
and broken 500 error responses.
Fixes Bug 1 in issue: Greenstand/treetracker-infrastructure#315
Related to issue: Greenstand/treetracker-infrastructure#300
Why
PGPool.js
isFetching[sql] = truepermanently, freezing allfuture requests for that SQL string and leaking queued callbacks
getQuery()Promise never rejected on DB error — callers hungindefinitely with no error signal
app.js
errorinstead ofcaught
e, causing aReferenceErrorthat prevented 500 responsesfrom being sent
throw errinside non-asyncmap.render()andfromStringcallbacks bypassed the outer try/catch, generating unhandled
exceptions that crash the Node process
Change
PGPool.js
cb(err, result)on both success and error paths
isFetching[sql]and drains the queue,calling each pending callback with the error
getQuery()consumer updated to handle(err, result)andpropagate errors via
rej(err)app.js
fromStringcallback: replacedthrow "failed"withreturn rej(err)_rej→rejto bring rejector into scopethrow errwithreturn rej(err)error→eFollow-up
PGPool.js(fetch failure, queue drain)and
app.js(rej propagation) to be added in a subsequent PR perCONTRIBUTING.md testing requirements.
Type of change