Skip to content

Conversation

@adoroszlai
Copy link
Contributor

What changes were proposed in this pull request?

HDFS-13566 added code in IPC Listener to rename the current thread:

https://github.com/apache/hadoop/blob/c2385c021bafc521ca6c8c8037351192a97c126c/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Server.java#L1276-L1288

Listener(int port) throws IOException {
  address = new InetSocketAddress(bindAddress, port);
  // Create a new server socket and set to non blocking mode
  acceptChannel = ServerSocketChannel.open();
  acceptChannel.configureBlocking(false);
  acceptChannel.setOption(StandardSocketOptions.SO_REUSEADDR, reuseAddr);

  // Bind the server socket to the local host and port
  bind(acceptChannel.socket(), address, backlogLength, conf, portRangeConfig);
  //Could be an ephemeral port
  this.listenPort = acceptChannel.socket().getLocalPort();
  Thread.currentThread().setName("Listener at " +
      bindAddress + "/" + this.listenPort);

Listener is a Thread object, being created in an another thread. The result is that the other thread (usually the main thread) is renamed to Listener at ....

2023-05-28 19:01:47,676 [main] INFO  ipc.CallQueueManager (CallQueueManager.java:<init>(90)) - Using callQueue: class java.util.concurrent.LinkedBlockingQueue, queueCapacity: 2000, scheduler: class org.apache.hadoop.ipc.DefaultRpcScheduler, ipcBackoff: false.
...
2023-05-28 19:01:47,730 [Listener at 0.0.0.0/15002] INFO  ipc.CallQueueManager (CallQueueManager.java:<init>(90)) - Using callQueue: class java.util.concurrent.LinkedBlockingQueue, queueCapacity: 2000, scheduler: class org.apache.hadoop.ipc.DefaultRpcScheduler, ipcBackoff: false.
...
2023-05-28 19:01:47,749 [Listener at 0.0.0.0/15001] INFO  ipc.CallQueueManager (CallQueueManager.java:<init>(90)) - Using callQueue: class java.util.concurrent.LinkedBlockingQueue, queueCapacity: 2000, scheduler: class org.apache.hadoop.ipc.DefaultRpcScheduler, ipcBackoff: false.
...
2023-05-28 19:01:47,771 [Listener at 0.0.0.0/15000] INFO  ha.SCMServiceManager (SCMServiceManager.java:register(42)) - Registering service ContainerBalancer.
2023-05-28 19:01:47,772 [Listener at 0.0.0.0/15000] INFO  server.StorageContainerManager (StorageContainerManager.java:<init>(420)) - 

This has been fixed by HADOOP-18433, but only for Hadoop 3.4.0. Currently being backported to 3.3 line.

This PR adds a workaround in Ozone until we can upgrade to a Hadoop release with the fix.

https://issues.apache.org/jira/browse/HDDS-8715

How was this patch tested?

Ran some integration test and verified log:

2023-05-28 16:38:00,149 [main] INFO  ipc.CallQueueManager (CallQueueManager.java:<init>(90)) - Using callQueue: class java.util.concurrent.LinkedBlockingQueue, queueCapacity: 2000, scheduler: class org.apache.ha
doop.ipc.DefaultRpcScheduler, ipcBackoff: false.
2023-05-28 16:38:00,188 [Listener at 0.0.0.0/15002] INFO  server.StorageContainerManager (StorageContainerManager.java:startRpcServer(1097)) - Restoring thread name main
...
2023-05-28 16:38:00,202 [main] INFO  ipc.CallQueueManager (CallQueueManager.java:<init>(90)) - Using callQueue: class java.util.concurrent.LinkedBlockingQueue, queueCapacity: 2000, scheduler: class org.apache.hadoop.ipc.DefaultRpcScheduler, ipcBackoff: false.
2023-05-28 16:38:00,203 [Listener at 0.0.0.0/15001] INFO  server.StorageContainerManager (StorageContainerManager.java:startRpcServer(1097)) - Restoring thread name main
...
2023-05-28 16:38:00,222 [main] INFO  ipc.CallQueueManager (CallQueueManager.java:<init>(90)) - Using callQueue: class java.util.concurrent.LinkedBlockingQueue, queueCapacity: 2000, scheduler: class org.apache.hadoop.ipc.DefaultRpcScheduler, ipcBackoff: false.
2023-05-28 16:38:00,223 [Listener at 0.0.0.0/15000] INFO  server.StorageContainerManager (StorageContainerManager.java:startRpcServer(1097)) - Restoring thread name main
2023-05-28 16:38:00,245 [main] INFO  ha.SCMServiceManager (SCMServiceManager.java:register(42)) - Registering service ContainerBalancer.
2023-05-28 16:38:00,245 [main] INFO  server.StorageContainerManager (StorageContainerManager.java:<init>(420)) - 

https://github.com/adoroszlai/hadoop-ozone/actions/runs/5104931948

@adoroszlai adoroszlai self-assigned this May 28, 2023
@adoroszlai adoroszlai marked this pull request as draft May 29, 2023 19:45
@adoroszlai adoroszlai marked this pull request as ready for review May 30, 2023 05:30
Copy link
Contributor

@siddhantsangwan siddhantsangwan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the pr @adoroszlai. LGTM.

@adoroszlai adoroszlai merged commit f5ba2f5 into apache:master May 31, 2023
@adoroszlai adoroszlai deleted the HDDS-8715 branch May 31, 2023 07:08
@adoroszlai
Copy link
Contributor Author

Thanks @kerneltime, @siddhantsangwan for the review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants