Gargi-jais11 commented on code in PR #11798:
URL: https://github.com/apache/ozone/pull/11798#discussion_r4399289593
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/transport/server/XceiverServerDomainSocket.java:
##########
@@ -230,6 +230,14 @@ public void run() {
// usually when the xceiver count limit is hit.
LOG.warn("Got an exception. Peer {}", peer, ie);
IOUtils.closeQuietly(peer);
+ if (peer == null) {
+ // accept() itself failed, for example with no file descriptor left,
and would fail again right away
+ try {
+ Thread.sleep(TimeUnit.SECONDS.toMillis(1L));
+ } catch (InterruptedException e) {
+ // not restored: stop() clears isRunning before interrupting, and
a set flag would make the pause a spin
Review Comment:
The comment is about why the interrupt flag was not restored after the
pause. Only **stop()** interrupts this thread, and it sets isRunning to false
first, so after an interrupted pause the loop exits anyway. I think that's what
confusing u.
Better I replaced the empty catch with the usual
`Thread.currentThread().interrupt()`, which needs no comment. The loop still
exits at once on stop(), and the shutdown path behaves the same as when stop()
interrupts a blocked accept().
--
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]