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
{{ message }}
Repository navigation
AsyncProgressQueueWorker::Signal() does not trigger the TSFN #1095
Linking to #853 as it introduced the problem of discarding nullptr data while process progress, whilst Signal sends a nullptr data to signal the worker.
@KevinEady the problem introduced in #853 is that it unconditionally suppressed the calls when the data is nullptr, for timing details you can checkout the graph here #821 (comment). So I believe we should try to find a way to distinguish Signals (a user-initiated action) from duplicated activation from second uv idle callback (not a user-initiated action).
Signal is a user-initiated action that will trigger the worker to call the progress callback even if there is no progress data available. Yet, if there is any progress data available, Signal just do nothing. For reference, AsyncProgressWorker and AsyncProgressQueueWorker is designed to be compatible (in our best effort) with nan's AsyncProgressWorker.
This issue is stale because it has been open many days with no activity. It will be closed soon unless the stale label is removed or a comment is made.
Current state: I have an implementation that solves this issue, but it suffers from the "not all of the async Signal() calls (which calls the TSFN NonBlockingCall()) get executed. We discussed in 28 Jan meeting to port the implementation over to Node-API directly (without using the node-addon-api wrapper) to see if it's an issue with the underlying thread-safe functions APIs or with the wrapper. This is currently ongoing.
This issue is stale because it has been open many days with no activity. It will be closed soon unless the stale label is removed or a comment is made.
This issue is stale because it has been open many days with no activity. It will be closed soon unless the stale label is removed or a comment is made.
This issue is stale because it has been open many days with no activity. It will be closed soon unless the stale label is removed or a comment is made.
Activity
legendecas commentedon Oct 26, 2021
Linking to #853 as it introduced the problem of discarding
nullptrdata while process progress, whilstSignalsends anullptrdata to signal the worker.KevinEady commentedon Nov 5, 2021
Hi @legendecas , can you elaborate some more on the problem introduced in 853? Maybe we can discuss in today's call.
EDIT: Ah, I see it now:
node-addon-api/napi-inl.h
Lines 6010 to 6013 in e439222
node-addon-api/napi-inl.h
Lines 5999 to 6002 in e439222
node-addon-api/napi-inl.h
Lines 5736 to 5740 in e439222
node-addon-api/napi-inl.h
Lines 5727 to 5734 in e439222
node-addon-api/napi-inl.h
Lines 5976 to 5981 in e439222
I have been able to resolve via:
If this is the correct implementation, I can create a PR. Let's discuss in today's call.
KevinEady commentedon Nov 5, 2021
😅 The above fix might be a bit premature. Let's discuss in the call.
legendecas commentedon Nov 8, 2021
@KevinEady the problem introduced in #853 is that it unconditionally suppressed the calls when the data is nullptr, for timing details you can checkout the graph here #821 (comment). So I believe we should try to find a way to distinguish
Signals (a user-initiated action) from duplicated activation from second uv idle callback (not a user-initiated action).Signalis a user-initiated action that will trigger the worker to call the progress callback even if there is no progress data available. Yet, if there is any progress data available,Signaljust do nothing. For reference,AsyncProgressWorkerandAsyncProgressQueueWorkeris designed to be compatible (in our best effort) with nan's AsyncProgressWorker.github-actions commentedon Feb 7, 2022
This issue is stale because it has been open many days with no activity. It will be closed soon unless the stale label is removed or a comment is made.
KevinEady commentedon Feb 7, 2022
Current state: I have an implementation that solves this issue, but it suffers from the "not all of the async
Signal()calls (which calls the TSFNNonBlockingCall()) get executed. We discussed in 28 Jan meeting to port the implementation over to Node-API directly (without using the node-addon-api wrapper) to see if it's an issue with the underlying thread-safe functions APIs or with the wrapper. This is currently ongoing.github-actions commentedon May 9, 2022
This issue is stale because it has been open many days with no activity. It will be closed soon unless the stale label is removed or a comment is made.
github-actions commentedon Aug 29, 2022
This issue is stale because it has been open many days with no activity. It will be closed soon unless the stale label is removed or a comment is made.
github-actions commentedon Dec 28, 2022
This issue is stale because it has been open many days with no activity. It will be closed soon unless the stale label is removed or a comment is made.
KevinEady commentedon Dec 29, 2022
Fixed by #1216