[
https://issues.apache.org/jira/browse/RATIS-1150?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
runzhiwang updated RATIS-1150:
------------------------------
Description:
When primary or peer WritableByteChannel#write throw exception, we should
return it to client.
bq. static long writeTo(ByteBuf buf, DataStream stream) {
bq. final WritableByteChannel channel = stream.getWritableByteChannel();
bq. long byteWritten = 0;
bq. for (ByteBuffer buffer : buf.nioBuffers()) {
bq. try {
bq. byteWritten += channel.write(buffer);
bq. } catch (Throwable t) {
bq. throw new CompletionException(t);
bq. }
bq. }
bq. return byteWritten;
bq. }
was:
When primary or peer
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;
}
> Return exception of WritableByteChannel#write to client.
> --------------------------------------------------------
>
> Key: RATIS-1150
> URL: https://issues.apache.org/jira/browse/RATIS-1150
> Project: Ratis
> Issue Type: Sub-task
> Reporter: runzhiwang
> Assignee: runzhiwang
> Priority: Major
>
> When primary or peer WritableByteChannel#write throw exception, we should
> return it to client.
> bq. static long writeTo(ByteBuf buf, DataStream stream) {
> bq. final WritableByteChannel channel = stream.getWritableByteChannel();
> bq. long byteWritten = 0;
> bq. for (ByteBuffer buffer : buf.nioBuffers()) {
> bq. try {
> bq. byteWritten += channel.write(buffer);
> bq. } catch (Throwable t) {
> bq. throw new CompletionException(t);
> bq. }
> bq. }
> bq. return byteWritten;
> bq. }
--
This message was sent by Atlassian Jira
(v8.3.4#803005)