fix: PGPool error handling and app.js catch/callback bugs - #111
Conversation
|
@dadiorchen for your review. Fixes Bug 1 in issue: Greenstand/treetracker-infrastructure#315 |
|
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 |
|
Hi @dadiorchen , need your comments before I proceed with testing on the dev environment. |
|
hi @dadiorchen , requesting your review. |
|
latest status |
dadiorchen
left a comment
There was a problem hiding this comment.
This is good to me
To Deploy this, please let me know if there is any problem @arnoldcastro5000 because this repo is not a normal application
|
🎉 This PR is included in version 4.36.2 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
|
initial run failed due to github hard-failing actions v1. correcting build-deploy.yml |
|
workflow run now progressed beyond the build-deploy.yml corrections. error in Dockerfile: |
|
Summary of changes to build-deploy.yml
Summary of changes to Dockerfile
|
|
Deployed to prod on June 30, 2026. Deployment logs in slack. |
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