You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2020/08/24 23:50:34 UTC

[GitHub] [iceberg] RussellSpitzer opened a new pull request #1374: Fix FileHandle Leak in BaseDataReader for MetadataFiles

RussellSpitzer opened a new pull request #1374:
URL: https://github.com/apache/iceberg/pull/1374


   The core issue here was that previously when using CloseableIterable.filter
   The iterator generated by the wrapped Iterable would be wrapped by a Guava
   Iterator regardless of the wrapped iterators closable status. This means
   Calling Filter on an iterable would result in a CloseableIterable which
   generated incorrectly unclosable Iterators.
   
   To fix this we replace the Guava IterablesFilter operation with the
   FilterIterator class. This properly wraps the underlying closable iterator
   so that when we generate iterators we still get classes that can close
   their wrapped implementations.


----------------------------------------------------------------
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.

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



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


[GitHub] [iceberg] aokolnychyi commented on pull request #1374: Fix FileHandle Leak in BaseDataReader for MetadataFiles

Posted by GitBox <gi...@apache.org>.
aokolnychyi commented on pull request #1374:
URL: https://github.com/apache/iceberg/pull/1374#issuecomment-679510359


   I'd put `FilterIterator` into the `io` package instead of `util`. I think it makes more sense there. Other than that, LGTM.


----------------------------------------------------------------
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.

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



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


[GitHub] [iceberg] RussellSpitzer commented on a change in pull request #1374: Fix FileHandle Leak in BaseDataReader for MetadataFiles

Posted by GitBox <gi...@apache.org>.
RussellSpitzer commented on a change in pull request #1374:
URL: https://github.com/apache/iceberg/pull/1374#discussion_r475979668



##########
File path: api/src/test/java/org/apache/iceberg/io/TestableCloseableIterable.java
##########
@@ -0,0 +1,59 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.iceberg.io;
+
+import java.io.IOException;
+
+public class TestableCloseableIterable implements  CloseableIterable<Integer>{
+    private Boolean closed = false;

Review comment:
       Ah looks like "run checkstyle on this project" from IDEA only applies to non test files whoops!




----------------------------------------------------------------
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.

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



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


[GitHub] [iceberg] aokolnychyi commented on a change in pull request #1374: Fix FileHandle Leak in BaseDataReader for MetadataFiles

Posted by GitBox <gi...@apache.org>.
aokolnychyi commented on a change in pull request #1374:
URL: https://github.com/apache/iceberg/pull/1374#discussion_r475976608



##########
File path: api/src/test/java/org/apache/iceberg/io/TestCloseableIterable.java
##########
@@ -28,6 +29,36 @@
 
 public class TestCloseableIterable {
 
+  @Test
+  public void testFilterManuallyClosable() throws IOException {
+    TestableCloseableIterable iterable = new TestableCloseableIterable();
+    TestableCloseableIterable.TestableCloseableIterator iterator =

Review comment:
       nit: can we import `TestableCloseableIterator` and fit on one line?




----------------------------------------------------------------
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.

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



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


[GitHub] [iceberg] RussellSpitzer commented on pull request #1374: Fix FileHandle Leak in BaseDataReader for MetadataFiles

Posted by GitBox <gi...@apache.org>.
RussellSpitzer commented on pull request #1374:
URL: https://github.com/apache/iceberg/pull/1374#issuecomment-679422593


   cc @aokolnychyi + @rdblue 


----------------------------------------------------------------
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.

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



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


[GitHub] [iceberg] aokolnychyi commented on pull request #1374: Fix FileHandle Leak in BaseDataReader for MetadataFiles

Posted by GitBox <gi...@apache.org>.
aokolnychyi commented on pull request #1374:
URL: https://github.com/apache/iceberg/pull/1374#issuecomment-679767553


   I've tested locally and it solves the problem in metadata tables. I am merging it.


----------------------------------------------------------------
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.

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



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


[GitHub] [iceberg] aokolnychyi commented on pull request #1374: Fix FileHandle Leak in BaseDataReader for MetadataFiles

Posted by GitBox <gi...@apache.org>.
aokolnychyi commented on pull request #1374:
URL: https://github.com/apache/iceberg/pull/1374#issuecomment-679424459


   Looks good to me except formatting nits.


----------------------------------------------------------------
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.

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



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


[GitHub] [iceberg] rdblue commented on a change in pull request #1374: Fix FileHandle Leak in BaseDataReader for MetadataFiles

Posted by GitBox <gi...@apache.org>.
rdblue commented on a change in pull request #1374:
URL: https://github.com/apache/iceberg/pull/1374#discussion_r475976891



##########
File path: api/src/test/java/org/apache/iceberg/io/TestableCloseableIterable.java
##########
@@ -0,0 +1,59 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.iceberg.io;
+
+import java.io.IOException;
+
+public class TestableCloseableIterable implements  CloseableIterable<Integer>{
+    private Boolean closed = false;

Review comment:
       Looks like indentation (2 spaces) is off for this file (4 spaces). Can you fix it?




----------------------------------------------------------------
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.

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



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


[GitHub] [iceberg] RussellSpitzer commented on pull request #1374: Fix FileHandle Leak in BaseDataReader for MetadataFiles

Posted by GitBox <gi...@apache.org>.
RussellSpitzer commented on pull request #1374:
URL: https://github.com/apache/iceberg/pull/1374#issuecomment-679426122


   All cleaned up style wise


----------------------------------------------------------------
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.

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



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


[GitHub] [iceberg] aokolnychyi merged pull request #1374: Fix FileHandle Leak in BaseDataReader for MetadataFiles

Posted by GitBox <gi...@apache.org>.
aokolnychyi merged pull request #1374:
URL: https://github.com/apache/iceberg/pull/1374


   


----------------------------------------------------------------
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.

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



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


[GitHub] [iceberg] aokolnychyi commented on a change in pull request #1374: Fix FileHandle Leak in BaseDataReader for MetadataFiles

Posted by GitBox <gi...@apache.org>.
aokolnychyi commented on a change in pull request #1374:
URL: https://github.com/apache/iceberg/pull/1374#discussion_r475977817



##########
File path: api/src/test/java/org/apache/iceberg/io/TestableCloseableIterable.java
##########
@@ -0,0 +1,59 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.iceberg.io;
+
+import java.io.IOException;
+
+public class TestableCloseableIterable implements  CloseableIterable<Integer>{

Review comment:
       Extra space after `implements` and no space before `{`




----------------------------------------------------------------
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.

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



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


[GitHub] [iceberg] aokolnychyi commented on a change in pull request #1374: Fix FileHandle Leak in BaseDataReader for MetadataFiles

Posted by GitBox <gi...@apache.org>.
aokolnychyi commented on a change in pull request #1374:
URL: https://github.com/apache/iceberg/pull/1374#discussion_r475977817



##########
File path: api/src/test/java/org/apache/iceberg/io/TestableCloseableIterable.java
##########
@@ -0,0 +1,59 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.iceberg.io;
+
+import java.io.IOException;
+
+public class TestableCloseableIterable implements  CloseableIterable<Integer>{

Review comment:
       Extra space after `implements`




----------------------------------------------------------------
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.

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



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