You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "Aitozi (via GitHub)" <gi...@apache.org> on 2024/10/15 11:10:42 UTC

[PR] [core] Fix the KvQueryTableTest may stuck in loop [paimon]

Aitozi opened a new pull request, #4328:
URL: https://github.com/apache/paimon/pull/4328

   <!-- Please specify the module before the PR name: [core] ... or [flink] ... -->
   
   ### Purpose
   
   Before, it use the pattern as bellow, which will lead the ConcurrentHashMap stuck in loop 
   
   ```
   Map<String, String> test = new ConcurrentHashMap<>();
   test.computeIfAbsent(
           "a",
           new Function<String, String>() {
               @Override
               public String apply(String s) {
                   return test.remove("a");
               }
           });
   System.out.println(test);
   ```
   
   The `KvQueryTableTest` will stuck in the thread as below
   
   ![image](https://github.com/user-attachments/assets/9f09e938-6a6d-47ba-acbd-8b973aa0a0ad)
   
   
   <!-- What is the purpose of the change -->
   
   ### Tests
   
   <!-- List UT and IT cases to verify this change -->
   
   ### API and Format
   
   <!-- Does this change affect API or storage format -->
   
   ### Documentation
   
   <!-- Does this change introduce a new feature -->
   


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

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


Re: [PR] [core] Fix the KvQueryTableTest may stuck in loop [paimon]

Posted by "Aitozi (via GitHub)" <gi...@apache.org>.
Aitozi commented on PR #4328:
URL: https://github.com/apache/paimon/pull/4328#issuecomment-2415591265

   > 1、Does this must appear every time? 2、This is a bug in JDK?
   
   ```
   Map<String, String> test = new ConcurrentHashMap<>();
   test.computeIfAbsent(
           "a",
           new Function<String, String>() {
               @Override
               public String apply(String s) {
                   return test.remove("a");
               }
           });
   System.out.println(test);
   ```
   
   In jdk8 it will stuck, in jdk11 it will throw `IllegalStageException`. I think it's a wrong use case. So, we should avoid to modify the map in the `computeIfAbsent` call.


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

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


Re: [PR] [core] Fix the KvQueryTableTest may stuck in loop [paimon]

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi commented on PR #4328:
URL: https://github.com/apache/paimon/pull/4328#issuecomment-2415596636

   +1


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

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


Re: [PR] [core] Fix the KvQueryTableTest may stuck in loop [paimon]

Posted by "wwj6591812 (via GitHub)" <gi...@apache.org>.
wwj6591812 commented on PR #4328:
URL: https://github.com/apache/paimon/pull/4328#issuecomment-2414061868

   1、Does this must appear every time?
   2、This is a bug in JDK?


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

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


Re: [PR] [core] Fix the KvQueryTableTest may stuck in loop [paimon]

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi merged PR #4328:
URL: https://github.com/apache/paimon/pull/4328


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

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