-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[EventPipe] End user_events session upon continuation_stream closure #117435
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
[EventPipe] End user_events session upon continuation_stream closure #117435
Conversation
|
cc: @pavelsavara for websocket poll implementation |
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.
Pull Request Overview
This PR adds support for detecting remote disconnections on user_events-based EventPipe sessions by extending IPC streams with polling capabilities and wiring up a continuation stream to session logic.
- Introduce
IpcStreamPollFuncin IPC vtables and implementds_ipc_stream_pollvariants - Define
IpcContinuationStreamand addep_ipc_continuation_stream_connection_closedfor hangup detection - Refactor session streaming thread to handle
EP_SESSION_TYPE_USEREVENTSand unifiedep_session_type_uses_streaming_threadpredicate
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/native/eventpipe/ep-types-forward.h | Forward-declare IpcContinuationStream |
| src/native/eventpipe/ep-stream.h | Define IpcContinuationStream struct and closure API |
| src/native/eventpipe/ep-stream.c | Add ep_ipc_stream_poll_vcall and continuation-stream check |
| src/native/eventpipe/ep-session.h | Add continuation_stream field and streaming-thread predicate |
| src/native/eventpipe/ep-session.c | Refactor streaming thread to support user events and cleanup |
| src/native/eventpipe/ep-ipc-stream.h | Add IpcStreamPollFunc and ep_ipc_stream_poll_vcall prototype |
| src/native/eventpipe/ep-ipc-pal-types.h | Define EventPipeIpcPollEvents enum and poll timeout constant |
| src/native/eventpipe/ds-ipc.c | Replace DS_IPC_POLL_EVENTS_* with EP_IPC_POLL_EVENTS_* |
| src/native/eventpipe/ds-ipc-pal.h | Declare ds_ipc_stream_poll |
| src/native/eventpipe/ds-ipc-pal-websocket.c | Implement WebSocket poll func and update vtable |
| src/native/eventpipe/ds-ipc-pal-types.h | Remove old DiagnosticsIpcPollEvents enum |
| src/native/eventpipe/ds-ipc-pal-socket.c | Add socket poll func and vtable entry |
| src/native/eventpipe/ds-ipc-pal-namedpipe.c | Stub out named pipe poll func |
| src/native/eventpipe/ds-eventpipe-protocol.c | Always pass ds_ipc_stream_get_stream_ref(stream) |
a529a85 to
c7fc5e6
Compare
Revert moving IpcPollEvents to ep-ipc-pal-types header Use IpcStream base type directly in sessions Omit websocket ipc_stream_poll_func implementation Change continuation stream poll timeout to infinite Change returned PollEvent to none upon timeout
c131816 to
37c0056
Compare
ep-stream.h for ep_ipc_stream_writer_alloc that was transitively included by ep-file.h ep-ipc-stream.h for ep_ipc_stream_poll_vcall
Remove prefix from IpcPollEvents enums and infinite timeout define Expand connection closed detection to error case
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.
LGTM!
|
/ba-g The remaining failure is a build timeout on android x64 which should be #117615 |
User_events-based EventPipe sessions should end when the profiling process disconnects from the Diagnostic Port.
This PR does the following:
ds_ipc_stream_pollbased onds_ipc_pollep_ipc_continuation_stream_connection_closedto detect disconnects.Testing
Manual E2E testing with the same C program as #115265, except putting a
getcharbefore closing the socket from the client side.