You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ratis.apache.org by "Tsz-wo Sze (Jira)" <ji...@apache.org> on 2020/11/15 11:07:00 UTC
[jira] [Resolved] (RATIS-1150) Return DataStreamException to
client.
[ https://issues.apache.org/jira/browse/RATIS-1150?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Tsz-wo Sze resolved RATIS-1150.
-------------------------------
Fix Version/s: 1.1.0
Resolution: Fixed
I have merged the pull request. Thanks, [~yjxxtd]!
> Return DataStreamException to client.
> -------------------------------------
>
> Key: RATIS-1150
> URL: https://issues.apache.org/jira/browse/RATIS-1150
> Project: Ratis
> Issue Type: Sub-task
> Components: Streaming
> Reporter: runzhiwang
> Assignee: runzhiwang
> Priority: Major
> Fix For: 1.1.0
>
> Attachments: image-2020-11-13-09-15-38-822.png, screenshot-1.png
>
> Time Spent: 3h 10m
> Remaining Estimate: 0h
>
> When primary or peer WritableByteChannel#write throw exception, we should return it to client.
> {code:java}
> static long writeTo(ByteBuf buf, DataStream stream) {
> final WritableByteChannel channel = stream.getWritableByteChannel();
> long byteWritten = 0;
> for (ByteBuffer buffer : buf.nioBuffers()) {
> try {
> byteWritten += channel.write(buffer);
> } catch (Throwable t) {
> throw new CompletionException(t);
> }
> }
> return byteWritten;
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)