New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Drop unnecessary EventTarget::isFiringEventListeners() #723
Drop unnecessary EventTarget::isFiringEventListeners() #723
Conversation
I agree with this in theory -- I hope it's true in practice? 😬 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me
At least, it is passing the tests. If we do find cases where we don't, we can always fix those. |
I guess the comment inside EventTarget::innerInvokeEventListeners demonstrates that the isFiringEventListeners flag was insufficient to cover all edge cases anyway, at least in the case of an event listener with the 'once' flag. |
We could deploy |
We could but it would only work for Node, not other EventTargets. |
I guess the alternative is to do that in |
What I meant is that GCReachableRef only works for Nodes AFAIK, not other types of objects. My comment wasn't about the location of the GCReachableRef.
We could. My worries are that it is a risky time to be adding release assertions. Also, I bet the assertion would hit a lot with fuzzers, even before my patch. Last I checked, it wasn't hard to find such failures on the stress GC bot. |
oh sure, we'd have to change it to support all event targets. Now that I think about it, that could in turn incurr new perf cost so maybe not the best idea.
Doesn't that mean this patch will likely introduce a new regression?? Maybe we can somehow turn this assertion for just fuzzers. I'm worried that this change will lead to flaky JS failures or flaky website behavior and very hard to decipher / diagnose bug reports without some due diligence like that. |
Geoff and I are following up on Slack to see what coverage we have in terms of fuzzing or stress GC here. To be clear though, if this patch introduces a bug, I think it means the existing code was already unsafe. You should always be keeping your JS wrapper alive as long as you may fire events on it in the future. This means that you're supposed to already have a mechanism to keep your wrapper alive at the point you dispatch your event. If not, just keeping the wrapper alive during event firing is at best a band-aid and the flakiness you're worried about could already happen if the wrapper was not kept alive right before dispatching the event. My understanding is that this patch might make pre-existing bugs a bit more visible (which is not necessarily a bad thing). It is also not clear to be how much more likely a wrapper might get collecting during event firing vs before firing the event. |
Yeah, I understand that. But flaky failure happening more frequently is not great anyhow. |
Committed r294431 (250712@main): https://commits.webkit.org/250712@main Reviewed commits have been landed. Closing PR #723 and removing active labels. |
b337028