| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
In the worker pool example, the 'kWorkerFreedEvent' should be emitted in case of error as well. After adding new worker in the error handler, the pending tasks should be notified of an available worker.
There was a problem hiding this comment.
Thanks for noticing this!
Sorry, something went wrong.
emit kWorkerFreedEvent everytime a new worker is created
There was a problem hiding this comment.
Nice
Sorry, something went wrong.
Sorry, something went wrong.
In the worker pool example, the 'kWorkerFreedEvent' should be emitted in case of error as well. After adding new worker in the error handler, the pending tasks should be notified of an available worker. PR-URL: #33082 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
In the worker pool example, the 'kWorkerFreedEvent' should be emitted in case of error as well. After adding new worker in the error handler, the pending tasks should be notified of an available worker. PR-URL: #33082 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
In the worker pool example, the 'kWorkerFreedEvent' should be emitted in case of error as well. After adding new worker in the error handler, the pending tasks should be notified of an available worker. PR-URL: #33082 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
In the worker pool example, the 'kWorkerFreedEvent' should be emitted in case of error as well. After adding new worker in the error handler, the pending tasks should be notified of an available worker. PR-URL: #33082 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
| Back | FazBrowse Home | New Git URL |
Checklist
In the worker pool example, the kWorkerFreedEvent should be emitted in case of error as well. After adding new worker in the error handler, the pending tasks should be notified of an available worker.
For instance, assume that we create a worker pool with two workers. Then we call runTask thrice such that the first two tasks are still running when it's called for the third time. As a result, the third task will be enqueued and wait for a kWorkerFreedEvent. Now suppose that both of the first two tasks throw an error. In response, our error handler replaces the two existing workers with new ones. But if kWorkerFreedEvent is not emitted after replacing the workers, the third task which was enqueued will never (assuming no more tasks are added after that) know of an available worker and hence will never run.