You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "tlm365 (via GitHub)" <gi...@apache.org> on 2024/07/02 17:05:15 UTC

[PR] Fix incorrect double-checked-locking around `TestStreamScanSql#tEnv` [iceberg]

tlm365 opened a new pull request, #10605:
URL: https://github.com/apache/iceberg/pull/10605

   Resolves #10592.


-- 
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@iceberg.apache.org

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


Re: [PR] Fix incorrect double-checked-locking around `TestStreamScanSql#tEnv` [iceberg]

Posted by "amogh-jahagirdar (via GitHub)" <gi...@apache.org>.
amogh-jahagirdar commented on code in PR #10605:
URL: https://github.com/apache/iceberg/pull/10605#discussion_r1659508615


##########
flink/v1.19/flink/src/test/java/org/apache/iceberg/flink/source/TestStreamScanSql.java:
##########
@@ -55,7 +55,7 @@ public class TestStreamScanSql extends CatalogTestBase {
   private static final String TABLE = "test_table";
   private static final FileFormat FORMAT = FileFormat.PARQUET;
 
-  private TableEnvironment tEnv;
+  private volatile TableEnvironment tEnv;
 
   @Override
   protected TableEnvironment getTableEnv() {

Review Comment:
   Not strictly required for correctness, more of a minor performance improvement but you can add a temporary variable in `getTableEnv()` referencing tEnv since in most cases tEnv will already be initialized. See https://stackoverflow.com/a/3580658



-- 
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@iceberg.apache.org

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


Re: [PR] Fix incorrect double-checked-locking around `TestStreamScanSql#tEnv` [iceberg]

Posted by "tlm365 (via GitHub)" <gi...@apache.org>.
tlm365 commented on code in PR #10605:
URL: https://github.com/apache/iceberg/pull/10605#discussion_r1659528345


##########
flink/v1.19/flink/src/test/java/org/apache/iceberg/flink/source/TestStreamScanSql.java:
##########
@@ -55,7 +55,7 @@ public class TestStreamScanSql extends CatalogTestBase {
   private static final String TABLE = "test_table";
   private static final FileFormat FORMAT = FileFormat.PARQUET;
 
-  private TableEnvironment tEnv;
+  private volatile TableEnvironment tEnv;
 
   @Override
   protected TableEnvironment getTableEnv() {

Review Comment:
   @amogh-jahagirdar thanks for reviewing and nice ref link. I've updated 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.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

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