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
Noticed while working on #823: normally, if you try to call send_eof on an object at the same time that another task is already calling send_all or wait_send_all_might_not_block, then send_eof should raise BusyResourceError. But StapledStream.send_eof calls self.send_stream.aclose, which has a different semantics: it interrupts any pending calls. So right now StapledStream.send_eof has the wrong semantics.
To solve this, StapledStream should detect when another task is already calling a send method, and in that case make send_eof raise an exception instead of calling self.send_stream.aclose.
I have a fix for this in my #823 branch, that I'll post shortly.
The text was updated successfully, but these errors were encountered:
njsmith
added a commit
to njsmith/trio
that referenced
this issue
Aug 9, 2019
The only reason HalfCloseableStream existed as a separate interface
was because SSLStream couldn't support send_eof. But TLS 1.3 made it
possible to support send_eof! So now the static split doesn't make
sense. Instead, we move send_eof into the Stream interface (though it
can still fail at runtime with NotImplementedError), and get rid of
HalfCloseableStream. (Fixes: python-triogh-823.)
This also includes a fix for StapledStream.send_eof, that was revealed
by the new enhanced check_two_way_stream. (Fixes: python-triogh-1180).
Noticed while working on #823: normally, if you try to call
send_eof
on an object at the same time that another task is already callingsend_all
orwait_send_all_might_not_block
, thensend_eof
should raiseBusyResourceError
. ButStapledStream.send_eof
callsself.send_stream.aclose
, which has a different semantics: it interrupts any pending calls. So right nowStapledStream.send_eof
has the wrong semantics.To solve this,
StapledStream
should detect when another task is already calling a send method, and in that case makesend_eof
raise an exception instead of callingself.send_stream.aclose
.I have a fix for this in my #823 branch, that I'll post shortly.
The text was updated successfully, but these errors were encountered: