You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2023/01/19 20:42:30 UTC

[GitHub] [ozone] adoroszlai opened a new pull request, #4193: HDDS-7807. TarContainerPacker closes streams multiple times

adoroszlai opened a new pull request, #4193:
URL: https://github.com/apache/ozone/pull/4193

   ## What changes were proposed in this pull request?
   
   `TarContainerPacker` closes the underlying `GrpcOutputStream` multiple times:
   
   ```
   datanode_1  | java.lang.IllegalStateException: call already closed
   datanode_1  | 	at org.apache.ratis.thirdparty.com.google.common.base.Preconditions.checkState(Preconditions.java:502)
   datanode_1  | 	at org.apache.ratis.thirdparty.io.grpc.internal.ServerCallImpl.closeInternal(ServerCallImpl.java:218)
   datanode_1  | 	at org.apache.ratis.thirdparty.io.grpc.internal.ServerCallImpl.close(ServerCallImpl.java:211)
   datanode_1  | 	at org.apache.ratis.thirdparty.io.grpc.stub.ServerCalls$ServerCallStreamObserverImpl.onCompleted(ServerCalls.java:395)
   datanode_1  | 	at org.apache.hadoop.ozone.container.replication.GrpcOutputStream.close(GrpcOutputStream.java:106)
   datanode_1  | 	at org.apache.hadoop.ozone.container.keyvalue.TarContainerPacker.pack(TarContainerPacker.java:180)
   datanode_1  | 	at org.apache.hadoop.ozone.container.keyvalue.KeyValueContainer.packContainerToDestination(KeyValueContainer.java:902)
   datanode_1  | 	at org.apache.hadoop.ozone.container.keyvalue.KeyValueContainer.exportContainerData(KeyValueContainer.java:630)
   datanode_1  | 	at org.apache.hadoop.ozone.container.keyvalue.KeyValueHandler.exportContainer(KeyValueHandler.java:1038)
   datanode_1  | 	at org.apache.hadoop.ozone.container.ozoneimpl.ContainerController.exportContainer(ContainerController.java:167)
   datanode_1  | 	at org.apache.hadoop.ozone.container.replication.OnDemandContainerReplicationSource.copyData(OnDemandContainerReplicationSource.java:75)
   datanode_1  | 	at org.apache.hadoop.ozone.container.replication.GrpcReplicationService.download(GrpcReplicationService.java:60)
   ```
   
   The exception seems harmless, but it may be confusing and pollutes the log.
   
   This can be reproduced by adding assertion about number of `close()` calls in `TestTarContainerPacker`:
   
   ```
   AssertionFailedError: expected: <1> but was: <2>
   	at org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:55)
   	at org.junit.jupiter.api.AssertionUtils.failNotEqual(AssertionUtils.java:62)
   	at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:150)
   	at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:145)
   	at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:527)
   	at org.apache.ozone.test.SpyOutputStream.assertClosedExactlyOnce(SpyOutputStream.java:45)
   	at org.apache.hadoop.ozone.container.keyvalue.TestTarContainerPacker.pack(TestTarContainerPacker.java:216)
   ```
   
   This happens because `TarArchiveInputStream` and `TarArchiveOutputStream` both close the underlying in/output streams, so we only need to close these, not the underlying ones.
   
   https://issues.apache.org/jira/browse/HDDS-7807
   
   ## How was this patch tested?
   
   Added assertions in unit test.
   
   https://github.com/adoroszlai/hadoop-ozone/actions/runs/3960752311


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] adoroszlai commented on pull request #4193: HDDS-7807. TarContainerPacker closes streams multiple times

Posted by GitBox <gi...@apache.org>.
adoroszlai commented on PR #4193:
URL: https://github.com/apache/ozone/pull/4193#issuecomment-1398738290

   Thanks @sodonnel for the review.


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] adoroszlai merged pull request #4193: HDDS-7807. TarContainerPacker closes streams multiple times

Posted by GitBox <gi...@apache.org>.
adoroszlai merged PR #4193:
URL: https://github.com/apache/ozone/pull/4193


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org