Skip to content

Fixed SSE request not getting canceled and getting SSE stuck#2806

Merged
joeyballentine merged 1 commit intochaiNNer-org:mainfrom
RunDevelopment:SSE-STUCK-SSE-STUCK
Apr 19, 2024
Merged

Fixed SSE request not getting canceled and getting SSE stuck#2806
joeyballentine merged 1 commit intochaiNNer-org:mainfrom
RunDevelopment:SSE-STUCK-SSE-STUCK

Conversation

@RunDevelopment
Copy link
Member

So I discovered an interesting bug: closing a setting doesn't also close currently running requests. This has the effect that our resp.content.iter_chunks() for our SSE requests just gets stuck and halts forever. This is a problem, because we sometimes restart the worker to kill the current execution. When this bug occurs, the worker will restart and execute chains just fine, but no SSE events will reach the frontend. So no progress updates and broadcasts.

I fixed this by manually keeping track of open SSE forward requests and closing them when the worker stops. This causes the SSE forwards to reset properly.

@joeyballentine joeyballentine merged commit 43473c7 into chaiNNer-org:main Apr 19, 2024
@RunDevelopment RunDevelopment deleted the SSE-STUCK-SSE-STUCK branch April 19, 2024 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants