-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Fix incorrect nativeaot event thread / sequence number on shutdown #88941
Conversation
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas Issue DetailsOn shutdown of the event pipe infrastructure, any active session is disabled and the process info event is written (and rundown - but nativeaot doesn't emit any). The shutdown was being done in the This separates the shutdown of the event pipe infrastructure into an explicit call rather than part of process exit.
|
Would it be better to not destruct it by keeping this info in a thread static that does not have a destructor? Re-introducing RhShutdown that we got rid of in #80063 is replacing one set of problems with a different set of problems. |
a0f47c4
to
c04bff5
Compare
c04bff5
to
035833a
Compare
On shutdown of the event pipe infrastructure, any active session is disabled and the process info event is written (and rundown - but nativeaot doesn't emit any). The shutdown was being done in the
atexit
handler. We use athread_local EventPipeAotThreadHolderTLS
to track information about that thread as it pertains to event pipe - for example, the sequence number for events from that thread. That gets destructed, such that when we get to writing out the process info event during process exit, we write the event with the incorrect information (a reset sequence number). As a result, analysis (via TraceEvent, for example) flags that all the events before it have been dropped.This switches to using our existing thread exit callbacks to handle event pipe thread info cleanup instead of relying on the destructor and merges the paths around event pipe thread holder management for windows/non-windows.