Closed zazabe closed 11 years ago
Ok, I get it... it's about the instance_pool
in process_worker.js
.
When a job is retried, the completed job is pushed in a list of terminated job, to keep them for a later use.
When a job fail, if the fail
function return a value or emit something, the job is also added to the instance_pool
.
The bug appear when the last retry failed, the same job instance will be added 2 times into the pool.
So the same job can be reused at the same time, 2 times... and it produce the bug described above...
bug fix in the pull request
Hi,
When I try to handle cases with a recurrent error response to my request, the node.io task hang.
After some debugging, I found a strange issue, request callback seems not be executed in the correct scope.
Consider this code:
Code
Output
The
task_2
with job idd8m6kvjtn
should not receive the response in jobep4hhkh5p
, used for thetask_3
normally...So with the code above, nodeio will hang and the callback will receive the response on a wrong job. (the job id set as an attribute of the instance will be different than the scope defined id).
It will work perfectly with
max
option set to1
but will hang if the number of job alowed at the same time is not greater than the number of input.Is it because I'm doing something wrong or the code above should work normally ?
I start to investigate more deeply inside node.io sources, I think the problem come from the "request" library and/or the creation of child process to handle jobs...
Thanks