[
https://issues.apache.org/jira/browse/SSHD-1261?focusedWorklogId=760631&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-760631
]
ASF GitHub Bot logged work on SSHD-1261:
----------------------------------------
Author: ASF GitHub Bot
Created on: 22/Apr/22 06:25
Start Date: 22/Apr/22 06:25
Worklog Time Spent: 10m
Work Description: lgoldstein commented on PR #218:
URL: https://github.com/apache/mina-sshd/pull/218#issuecomment-1106054820
> Terminating the current future is probably right, but still I don't think
this will help in all situations
I gues you are right - let's plug this "hole" and then think about the rest
Issue Time Tracking
-------------------
Worklog Id: (was: 760631)
Time Spent: 20m (was: 10m)
> Sometimes async write listener is not called
> --------------------------------------------
>
> Key: SSHD-1261
> URL: https://issues.apache.org/jira/browse/SSHD-1261
> Project: MINA SSHD
> Issue Type: Bug
> Affects Versions: 2.8.0
> Reporter: Evgeny Pasynkov
> Assignee: Lyor Goldstein
> Priority: Major
> Time Spent: 20m
> Remaining Estimate: 0h
>
> Hello,
> I have discovered the case when the async write listener is not called.
> Imagine the case: The `ChannelAsyncOutputStream::doWriteIfPossible` method
> discover that window size is too small (lines 160-167). It setup new future
> and exit the doWriteIfPossible method, relying on `onWindowExpanded` will be
> called shortly. But if the channel is disconnected, the method will never be
> invoked, thus future won't be completed.
> I suggest adding the following override to ChannelAsyncOutputStream class:
> {code:java}
> @Override
> protected void doCloseImmediately() {
> abortCurrentWrite();
> super.doCloseImmediately();
> }
> protected synchronized void abortCurrentWrite() {
> IoWriteFutureImpl future = pendingWrite.get();
> if (future != null) {
> future.setValue(new ClosedChannelException());
> }
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.20.7#820007)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]