-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Mark,
On 1/12/18 3:27 AM, Mark Thomas wrote:
> On 12/01/18 08:04, Rémy Maucherat wrote:
>> On Fri, Jan 12, 2018 at 12:06 AM, Mark Thomas <ma...@apache.org>
>> wrote:
>> 
>>> Hi,
>>> 
>>> I've been looking at how we close NIO channels and I think
>>> there is an opportunity for a little clean-up that, in turn,
>>> may allow a little de-duplication between NIO and NIO2.
>>> 
>>> Currently, in various places in the codebase we close an NIO
>>> channel using some variation of:
>>> 
>>> channel.socket().close(); channel.close();
>>> 
>>> My reading of the Javadoc, source code and some debugging
>>> suggests that these lines are equivalent and that we can simply
>>> do:
>>> 
>>> channel.close();
>>> 
>>> Across the codebase, you end up with a patch like this: 
>>> http://people.apache.org/~markt/patches/2018-01-11- 
>>> channel-close-tc9-v1.patch
>>> 
>>> Before I apply this patch to trunk, can anyone see anything I
>>> am missing here? Is there a reason to keep the code as it is?
>>> 
>> Interesting attempt. As usual, the main reason to keep the code
>> as is is: it works :)
> 
> Fair point. Working is definitely a good thing :)
> 
> But, if the first line is unnecessary, then there are some small 
> benefits to removing it. I've run the unit tests (which give pretty
> good coverage of I/O edge cases) and they all pass with the patch
> applied.
> 
> On the other hand, if the change is viewed as too risky, I'd be
> happy to put it on the back-burner until we start thinking about
> Tomcat 10.

As Tomcat 9 is still unstable/beta, I'd be +1 for committing to Tomcat
9, but not back-porting to Tomcat 8/8.5. Less code (even if it's only
~30 lines source-wide) is always better, assuming equivalent behavior.

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQJRBAEBCAA7FiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlpZIdcdHGNocmlzQGNo
cmlzdG9waGVyc2NodWx0ei5uZXQACgkQHPApP6U8pFgNnhAAt7OdJ8qFtc/bpE96
b6Rw3xIBZzAZ3RhL0Q4v2VMOoRtTSFf1y/44ElugIlJW4CmoGTiNxNgdrjWsQFqJ
9y2uQQP0TTSzGeDBqf+vPmkR8r0PdykhgofM3sOYGEZilkEg4YSTcdQRPtQGl2SS
GmtMQ7AL5GizgRshMuAJzTM0LL1/pWe5FTTGrGFZe/MmNOsbY0TjDEsM2kFVCulN
FVypyLdxRDDIWtZTxrBwd54fr7Z3r2JtrCPzPvy+pEKDrFetHl1xF83B5T0RzZTX
g5HIbRglNKkeh9XqGsCpgSbYa76UVSVqr4wu7Im0xaMGdQ71aFh6/d03cXVJzRfY
gONeBFX00nmkxuSj4Nl3s/snWPmONJqdN/c55EYYHDM0KBiSGWcV9bCGANNZs8RZ
vtuwGXd/KN6jfMl51h7Yuo67flL3VmRaXHPOx2a7VIxlmS5gzXoAbAcy/mU+9HYy
5KyjTt8QGiV5vNhHgEbo0O2xJ4d3+SKqvFb72bMqSH0kvnpA8ThA4eOcODJHlAH0
07yOual98utaHKkbcbgzqP8VLTLgTSyyJuWaWTWidUeBpzxlPezXE1XFXyhcm9tu
9CdsQ7S+9IMRo8+UsOHYJSV2R5UWXL5Hb63Kiinsfkr5tZGafeLudJPAVpn4WafA
mCd2cmld2FZp9cNYCohxjG2VbGI=
=5EiE
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to