eclipse-ee4j / eclipse-ee4j/jersey

EventSource.close() does not immediately close the connection

Open
#4,549 2 comments 0 reactions 0 assignees View on GitHub
sse
Dominant language
Java
Stars
730
Forks
382
PR merge metrics
No merged PRs in 30d

Description

This is basically a duplicate of https://github.com/eclipse-ee4j/jersey/issues/3182 which was marked as resolved, however I still find the exact same behaviour.

**Affected component:** media-sse
**Affected version(s):** 2.22.2, 2.31

**Issue**
When closing a SSE connection on client side using EventSource.close(), the implementation only sets a flag to indicate that no more events should be handled.
However, if the EventSource was already opened, the EventProcessor that it created will already in the loop reading events from the EventInput that it fetches from the request. As long as this EventInput is not interrupted/closed, the EventProcessor WILL read 1 more event until it finally reaches the while loop again and shuts down.

There needs to be a solution which immediately kills the connection on client side and does not process any more events.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.