GitHub user uce opened a pull request:
https://github.com/apache/incubator-flink/pull/255
[FLINK-998] Close TCP connections after destroying logical channels
This commit introduces reference-counting to keep track of the InputChannel
and OutputChannel instances, which share the same physical TCP connection. This
is basically a backport from #254.
When the logical channels are released in the channel manager, the
reference count will reach 0 and the respective TCP connection can safely be
closed.
Furthermore, the debug thread in the OutboundConnectionQueue is properly
shut down and all queued buffers are freed when the channel is closed or an
Exception occurs.
I've tested it on a 4 node cluster with parallelism of 32 and the debug
output thread showed that connections are closed successfully. I've also tested
cancelling. It would be nice to review this thoroughly though. ;-)
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/uce/incubator-flink
flink-998-close_tcp_connections
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/incubator-flink/pull/255.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #255
----
commit 1f8afb470bf3d995595e5a36964fde122da187ae
Author: Ufuk Celebi <[email protected]>
Date: 2014-12-08T22:55:13Z
[FLINK-998] Close TCP connections after destroying logical channels
- This commit introduces reference-counting to keep track of the
InputChannel and OutputChannel instances, which share the same
physical TCP connection.
- When the logical channels are released, the reference count will
reach 0 and the respective TCP connection can safely be closed.
- Furthermore, the debug thread in the OutboundConnectionQueue is
properly shut down and all queued buffers are freed when the
channel is closed or an Exception occurs.
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---