You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Java] Calls on a closed stream throw a retryable ZerobusException #1225
BaseZerobusStream.ensureOpen() throws new ZerobusException("Stream is closed") in two cases: after close() freed the native handle, and when the native stream is already closed (for example after a terminal failure). ZerobusException is the retryable class, so a caller that retries retryable errors with backoff retries a closed stream forever.
The Rust core reports the same condition as InvalidStateError, which is not retryable. A Java call that reaches the native layer during a close also gets NonRetriableException, so the error class a caller sees depends on timing.
Where: java/src/main/java/com/databricks/zerobus/BaseZerobusStream.java, ensureOpen() (both throw new ZerobusException("Stream is closed") lines).
Proposed fix
Throw NonRetriableException("Stream is closed") in both cases, and say in the Javadoc and the README that a call on a closed stream is not retryable. Multiplexed streams do the same (#1195).
Compatibility
NonRetriableException extends ZerobusException, so catch (ZerobusException e) still catches it. Code that retries on the exact class stops retrying a closed stream, which is the intended change; it needs a changelog entry under Bug Fixes.
Activity