apple / apple/servicetalk

`releaseAsync()` for reserved connections is not idempotent

Open
#148 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
1k
Forks
229
Avg merge
23h 23m
Merged PRs (30d)
16

Description

`releaseAsync()` is advertised as idempotent but we do not allow subscribing twice to it. In order to simplify user control flow, we should make `releaseAsync()` idempotent just like `closeAsync()`. Otherwise users have to take precautions while releasing.
A typical usecase would be to release the connection on any of the terminal events: cancel, complete, error. If `releaseAsync()` is not idempotent, users have to protect subscribing to `releaseAsync()` in these 3 cases.

Contributor guide

Open the contributing guide

Research direction

Start by locating the reserved-connection implementation of `releaseAsync()` and compare its behavior with `closeAsync()`. Trace how repeated subscriptions are handled and add or update focused tests for the terminal-event use case. Done means multiple subscriptions to `releaseAsync()` are safe and the existing release behavior remains correct.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.