Skip to content
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(core, ui): send a "start" event to be sure the UI receive the SSE #6731

Merged
merged 1 commit into from
Jan 14, 2025

Conversation

loicmathieu
Copy link
Member

@loicmathieu loicmathieu commented Jan 13, 2025

The UI only store a reference to the logs SSE when receive the first event. In case a flow didn't emit any log, or the logs tab is closed before any logs is emitted, the UI will not have any reference to the SSE so the SSE connection would stay alive forever. Each SSE connection starts a thread via the logs queue, creating a thread leak.

Sending a first "start" event makes sure the UI has a reference to the SSE.

Closes #6725

Validated manually: before the patch, threads keeps being created and not destroyed for the logQueue, after the patch threads are correctly destroyed.

May fix #3402

The UI only store a reference to the logs SSE when receive the first event.
In case a flow didn't emit any log, or the logs tab is closed before any logs is emitted, the UI will not have any reference to the SSE so the SSE connection would stay alive forever.
Each SSE connection starts a thread via the logs queue, creating a thread leak.

Sending a first "start" event makes sure the UI has a reference to the SSE.
@loicmathieu loicmathieu merged commit 0c0ff37 into develop Jan 14, 2025
11 checks passed
@loicmathieu loicmathieu deleted the fix/logs-sse branch January 14, 2025 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
1 participant