You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On the line 490 there is a assignment resolver.promise.timeout = timeout;. Doc of the method says timeout param is a number, but Promise object has a method called timeout. Seems like an attempt to override a method with a number. Task object however has a property timeout:number. Luckily it seems nowhere in the code this method WorkerHandler.prototype.terminateAndNotify gets called with the second argument.
Is it a bug in abandoned code?
Second one. Lets take a look at how TERMINATE_METHOD_ID is used.
There is no problem when it gets directly sent to a worker, however when it gets added to the requestQueue there is a problem, because this is how requestQueue is being processed:
I think this is indeed a bug. The method terminateAndNotify is called with the second timeout argument only from the public Pool.terminate method. I commented the line resolver.promise.timeout = timeout;, but still all tests pass. I expect that the terminate timeout simply doesn't work and isn't tested. The solution most likely is to change that line to resolver.promise.timeout(timeout).
I think you're right, it should be something like this.requestQueue.push({ message: TERMINATE_METHOD_ID });.
I think it's best to address these bugs separately from the refactor and make sure they are properly tested.
While I'm rewriting the code to Typescript, I found two things that I would rather ask here since it looks like bugs.
workerpool/src/WorkerHandler.js
Lines 483 to 494 in 8219f7d
On the line 490 there is a assignment
resolver.promise.timeout = timeout;
. Doc of the method says timeout param is anumber
, butPromise
object has a method calledtimeout
. Seems like an attempt to override a method with a number. Task object however has a propertytimeout:number
. Luckily it seems nowhere in the code this methodWorkerHandler.prototype.terminateAndNotify
gets called with the second argument.Is it a bug in abandoned code?
TERMINATE_METHOD_ID
is used.workerpool/src/WorkerHandler.js
Line 11 in 8219f7d
workerpool/src/WorkerHandler.js
Lines 450 to 454 in 8219f7d
There is no problem when it gets directly sent to a worker, however when it gets added to the
requestQueue
there is a problem, because this is howrequestQueue
is being processed:workerpool/src/WorkerHandler.js
Lines 272 to 278 in 8219f7d
Looks like instead of
TERMINATE_METHOD_ID
undefined gets sent. Correct me if I'm wrong please.The text was updated successfully, but these errors were encountered: