szetszwo commented on code in PR #9304:
URL: https://github.com/apache/ozone/pull/9304#discussion_r2532269951
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/stream/StreamingClient.java:
##########
@@ -86,11 +86,17 @@ public void stream(String id) {
}
public void stream(String id, long timeout, TimeUnit unit) {
+ Channel channel = null;
try {
- Channel channel = bootstrap.connect(host, port).sync().channel();
- channel.writeAndFlush(id + "\n")
- .await(timeout, unit);
- channel.closeFuture().await(timeout, unit);
+ channel = bootstrap.connect(host, port).sync().channel();
+ boolean writeSuccess = channel.writeAndFlush(id + "\n").await(timeout,
unit);
+ if (!writeSuccess) {
+ throw new StreamingException("Write operation timed out");
Review Comment:
Let's include more information in the error message
```java
"Failed to write id " + id + ": timed out " + timeout + " " + unit
```
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/stream/StreamingClient.java:
##########
@@ -86,11 +86,17 @@ public void stream(String id) {
}
public void stream(String id, long timeout, TimeUnit unit) {
+ Channel channel = null;
try {
- Channel channel = bootstrap.connect(host, port).sync().channel();
- channel.writeAndFlush(id + "\n")
- .await(timeout, unit);
- channel.closeFuture().await(timeout, unit);
+ channel = bootstrap.connect(host, port).sync().channel();
+ boolean writeSuccess = channel.writeAndFlush(id + "\n").await(timeout,
unit);
+ if (!writeSuccess) {
+ throw new StreamingException("Write operation timed out");
+ }
+ boolean closeSuccess = channel.closeFuture().await(timeout, unit);
+ if (!closeSuccess) {
+ throw new StreamingException("Close operation timed out");
Review Comment:
Similarly,
```java
"Failed to close channel for id " + id + ": timed out " + timeout + " " +
unit
```
--
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]