node icon indicating copy to clipboard operation
node copied to clipboard

Can --trace-atomics-wait be removed

Open syg opened this issue 2 years ago • 10 comments

What is the problem this feature will solve?

The V8 API hook (SetAtomicsWaitCallback) to support --trace-atomics-wait is fairly complex and adds maintenance burden. Further the only user of the API is node, and node only uses a subset of the functionality, and only for diagnostic purposes.

Is it feasible to remove this diagnostic functionality? Judging by the original commit message the original motivation was maybe to use the hooks to build a deadlock detection system, not just printf diagnostics. It's been 4 years since then, and if no such system has been prototyped and it's not on the roadmap anytime soon, I'd like to deprecate and remove the V8 API.

cc @addaleax

What is the feature you are proposing to solve the problem?

Remove --trace-atomics-wait

What alternatives have you considered?

No response

syg avatar May 05 '22 23:05 syg

@syg I am personally fine with anything here. --trace-atomics-wait has been useful for me in the past occasionally, and the thing about it is that it’s useful specifically in situations in which it can be hard to debug with other tools, but if you feel that it’s not worth it, sure, drop it.

addaleax avatar May 06 '22 16:05 addaleax

@syg I am personally fine with anything here. --trace-atomics-wait has been useful for me in the past occasionally, and the thing about it is that it’s useful specifically in situations in which it can be hard to debug with other tools, but if you feel that it’s not worth it, sure, drop it.

Given the current functionality of --trace-atomics-wait tracing the Atomics.wait events (not using the handle to interrupt waits), is it possible to do that in userland? I guess the problem is that on a failure to wait, regardless of whether you re-read the address after the fact or buffer the address beforehand, there's still no guarantee if that value is what caused it to fail?

syg avatar May 06 '22 17:05 syg

Another option here is to keep the pre-hook needed for --trace-atomics-wait, remove the other hooks, as well as the handle. The handle is probably 70% of the complexity I want to remove.

syg avatar May 06 '22 17:05 syg

I created https://github.com/nodejs/node/pull/44093 to start the deprecation process & for further discussion.

kvakil avatar Aug 02 '22 02:08 kvakil

There has been no activity on this feature request for 5 months and it is unlikely to be implemented. It will be closed 6 months after the last non-automated comment.

For more information on how the project manages feature requests, please consult the feature request management document.

github-actions[bot] avatar Jan 30 '23 01:01 github-actions[bot]

There has been no activity on this feature request for 5 months and it is unlikely to be implemented. It will be closed 6 months after the last non-automated comment.

For more information on how the project manages feature requests, please consult the feature request management document.

github-actions[bot] avatar Aug 03 '23 01:08 github-actions[bot]

We should probably runtime deprecate it to move forward with this.

aduh95 avatar Aug 03 '23 05:08 aduh95

Moving to runtime deprecation with https://github.com/nodejs/node/pull/51179

marco-ippolito avatar Dec 16 '23 13:12 marco-ippolito

@syg the flag has moved to runtime deprecation, afaik it will be released in the next major (22).

marco-ippolito avatar Dec 22 '23 16:12 marco-ippolito

After this PR: https://github.com/nodejs/node/pull/52747 it will be completely removed

marco-ippolito avatar Apr 29 '24 10:04 marco-ippolito