Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When using nfs-client to transfer a file greater than 1024 * 1024, the following error occurs:
Tcp IO error on the connection,the reason for this may be that the pipeline reader is closed, BROKEN PIPE error is generated, and Tcp IO error exception is thrown. Because the server source code is not clear, my guess about this problem is as follows:
In channel.write (), the CompositeChannelBuffer is sent as a message. The size of the message is limited to 1024 * 1024 on the server, while in NfsFileOutputStream, __ buffer_ is the byte array that actually stores the data (size 1024 * 1024), which must be filled before the data is sent.
But,message = metadata + data.
So one possibility is that the server limits the size of an overall message, while message contains metadata, so the actual data carried can only be less than 1024 * 1024.
So I think one way to solve bug is to adjust the default size of __ buffer_:
__ buffer = new byte [(int) Math.min (_ nfsFile.fsinfo () .getFsInfo () .wtpref, Integer.MAX_VALUE)-bufferSize]_.
Set aside some space for metadata storage to ensure that the whole message is not greater than 1024 * 1024