adoroszlai opened a new pull request, #4215:
URL: https://github.com/apache/ozone/pull/4215
## What changes were proposed in this pull request?
Fix `Block(Input/Output)Stream` to release the gRPC client on `close` and
`unbuffer` to avoid:
```
SEVERE: *~*~*~ Channel ManagedChannelImpl{logId=1786,
target=127.0.0.1:39499} was not shutdown properly!!! ~*~*~*
Make sure to call shutdown()/shutdownNow() and wait until
awaitTermination() returns true.
java.lang.RuntimeException: ManagedChannel allocation site
at
org.apache.ratis.thirdparty.io.grpc.internal.ManagedChannelOrphanWrapper$ManagedChannelReference.<init>(ManagedChannelOrphanWrapper.java:93)
...
at
org.apache.ratis.thirdparty.io.grpc.internal.AbstractManagedChannelImplBuilder.build(AbstractManagedChannelImplBuilder.java:297)
at
org.apache.hadoop.hdds.scm.XceiverClientGrpc.connectToDatanode(XceiverClientGrpc.java:188)
at
org.apache.hadoop.hdds.scm.XceiverClientGrpc.connect(XceiverClientGrpc.java:158)
at
org.apache.hadoop.hdds.scm.XceiverClientManager$2.call(XceiverClientManager.java:243)
at
org.apache.hadoop.hdds.scm.XceiverClientManager$2.call(XceiverClientManager.java:224)
at
com.google.common.cache.LocalCache$LocalManualCache$1.load(LocalCache.java:4868)
...
at
com.google.common.cache.LocalCache$LocalManualCache.get(LocalCache.java:4863)
at
org.apache.hadoop.hdds.scm.XceiverClientManager.getClient(XceiverClientManager.java:224)
at
org.apache.hadoop.hdds.scm.XceiverClientManager.acquireClient(XceiverClientManager.java:168)
at
org.apache.hadoop.hdds.scm.XceiverClientManager.acquireClientForReadData(XceiverClientManager.java:157)
at
org.apache.hadoop.hdds.scm.storage.BlockInputStream.acquireClient(BlockInputStream.java:261)
...
at
org.apache.hadoop.ozone.client.io.OzoneInputStream.read(OzoneInputStream.java:56)
```
and similar reports.
`TestOzoneRpcClientWithRatis` also had unclosed streams in the test itself,
fixed those, too.
https://issues.apache.org/jira/browse/HDDS-7838
## How was this patch tested?
Ran `TestStorageContainerManagerHA`, `TestFailureHandlingByClient` which
tend to have such errors in their output (even if the tests are passing).
Verified no `ManagedChannel` problem reported related to
`BlockInputStream`/`BlockOutputStream`.
Regular CI:
https://github.com/adoroszlai/hadoop-ozone/actions/runs/4018918379
https://github.com/adoroszlai/hadoop-ozone/actions/runs/4019832659
--
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]