Bug Fix: infinite Loop#1783
Conversation
|
Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA).
To sign the OCA, please create an Oracle account and sign the OCA in Oracle's Contributor Agreement Application. When signing the OCA, please provide your GitHub username. After signing the OCA and getting an OCA approval from Oracle, this PR will be automatically updated. If you are an Oracle employee, please make sure that you are a member of the main Oracle GitHub organization, and your membership in this organization is public. |
|
@willianmarquess Thank you for bringing this to our attention and the detailed analysis. Please note that we will evaluate the PR and then include the code changes from our end in an upcoming release (while giving you the due credit in the release notes :) ), based on our analysis and testing. We would also request you to sign the OCA agreement.
|
I am trying to sign, but I am encountering an error when trying to download the OCA document (I am from Brazil). |
Hi, there is an infinite loop bug that occurs in the bgThreadFunc() method:
I encountered this issue while analyzing a problem in a production environment where pods were freezing and restarting, this issue only occurs in services that handle high volumes of message processing via queues.
Mode: Thin
Problem:
When we configure a low number of connections in the pool (1, 4, 8, etc.) and the application experiences high concurrency (queue/event processing), it enters an infinite loop due to this part of code:
pool.js
How to reproduce:
This scenario only occurs in situations of high concurrency; I’ll leave an example here for you to reproduce the problem.
(this code is only trying to simulate an queue/event concurrent processing)
Solution:
I left a suggested three-part solution in the code:
1 - In
bgThreadFunc, check only for cases wherenumToCreate <= 0to perform theawaitand avoid entering sync infinite loop.2 - When calling
release(), check for any pending tasks and attempt to reuse and resolve them immediately.3 - When there is a pending task, we must wake up
bgWaiter().