xinglin commented on PR #6519: URL: https://github.com/apache/hadoop/pull/6519#issuecomment-1924495503
Thanks Simba for reviewing and approving PR. > Change LGTM. > > Is there a way to test this, that isn't too complicated. One path I see to get an exception from `Thread.start()` is calling it twice. The second call will throw `IllegalThreadStateException()`. So you can start `rpcRequestThread` before `Connection.run()` and then validate that the Connection is immediately marked as closed. To do this, i would assume we need to create the rpcRequestThread externally and start it and then add a new API setRpcRequestThread() to Connection class, to set it to the new thread. Does this sound right? Or we need to add a new constructor for Connection class, to take rpcRequestThread as a parameter. Doesn't sound worth doing this for testing this 'trivial' change. > I'm +1 without the test though. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
