Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Fixed unresolved promise in cancelQuery(..) ... #3666
... more specifically: cancelQuery(..) was attempting to
Later on, the cancellation would ACTUALLY fail due to a resource
... more specifically: cancelQuery(..) was attempting to "cancel the cancellation" after 100ms. However, it was not actually achieving this objective. In reality, the cancellation was still running in the background even though the caller had already moved on. Later on, the cancellation would ACTUALLY fail due to a resource allocation issue (ie: no more connections in the Tarn pool). This would then result in an unhandled Promise rejection.
@maximelkin + @kibertoad + @bywo : Proposing this as the fix for the "timeout" issue that was being observed. Although the PR at #3665 makes the unhandled promise issue go away, it is ultimately just obscuring the underlying problem. (the underlying problem being: there is an exception that cannot be caught/handled by the caller)
Sounds like the reason why timeout was there was to prevent case where connection could not have been acquired for cancelation.
This implementation looks fine to me. AFAIK Tarn's acquire connection timeout should automatically handle this case as it is used in this fix.
However it should be made sure that other dialect cancelation methods are fixed as well.