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

Connection close cancels pending writes #248

Closed
NiteshKant opened this issue Oct 22, 2014 · 0 comments
Closed

Connection close cancels pending writes #248

NiteshKant opened this issue Oct 22, 2014 · 0 comments
Assignees
Milestone

Comments

@NiteshKant
Copy link
Member

Currently ObservableConnection cancels any pending writes on the connection when it is closed. The reason for doing this is:

  • When a connection is physically closed, there is no point in writing to that as they will anyways fail.
  • For a pooled connection, when the connection is closed (returned to the pool), if there are pending writes then the next use of the connection would be wrong.

Now, when a write is cancelled, the actual result of the promise creates the following logging noise (at warn level):

2014-10-21 22:06:58,035 WARN  io.netty.util.internal.logging.Slf4JLogger:146 [rx-selector-1-3] [warn] Failed to mark a 
promise as failure because it's done already: DefaultChannelPromise@25a1a946(failure(java.util.concurrent.CancellationE
xception)

Since, in the usecase 1 outlined above, the cancellation of the write is purely an optimization, which will kick in only if the flush did not happen before the close, it seems worth to eliminate the cancel in favor of reducing this logging noise.

For the case 2 above, it is a requirement to preserve this write cancellation as it has a functional impact.

@NiteshKant NiteshKant self-assigned this Oct 22, 2014
@NiteshKant NiteshKant added this to the 0.3.15 milestone Oct 22, 2014
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

No branches or pull requests

1 participant