kocolosk opened a new pull request #3940:
URL: https://github.com/apache/couchdb/pull/3940
## Overview
This PR adds an extra `hello_from_writer` message into the handshake between
the process that reads the multipart attachment data from the socket and the
writer processes (potentially on remote nodes) that persist the data into each
shard file. This ensures that even in the case where a writer does not end up
asking for the data (e.g. because the revision already exists in the tree), the
parser will monitor the writer and therefore know when the writer has exited.
The patch makes some assumptions that the attachment flush function is
executed in the same process as the initial one that is spawned to handle the
fabric_rpc work request. That's true today, but if it changed in the future it
would be a non-obvious breakage to debug.
I'm not crazy about this solution to be quite honest, but I figured I could
put it up for review anyway and see what others think.
## Testing recommendations
I added an extra test to the `elixir-suite` target. Without this patch you
should find that the test eventually causes some other part of the suite to
hang, because the Erlang process handling one of the open TCP connections is
stuck waiting for the attachment parser to exit. Again, I wish the test failed
in a more obvious way, but I guess it's better than nothing.
## Related Issues or Pull Requests
Fixes #3939
## Checklist
- [x] Code is written and works correctly
- [x] Changes are covered by tests
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]