Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Concurrency issues in o.a.i.hive.MetastoreLock #10595

Open
snazy opened this issue Jun 28, 2024 · 3 comments
Open

Concurrency issues in o.a.i.hive.MetastoreLock #10595

snazy opened this issue Jun 28, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@snazy
Copy link
Member

snazy commented Jun 28, 2024

Apache Iceberg version

None

Query engine

None

Please describe the bug 馃悶

org.apache.iceberg.hive.MetastoreLock#acquireJvmLock can race with releaseJvmLock and produce a NullPointerException. Additionally, the implementation has concurrency issues.

The call to Thread.interrupted() in the InterruptedException catch blocks is meaningless.

@snazy snazy added the bug Something isn't working label Jun 28, 2024
@pvary
Copy link
Contributor

pvary commented Jul 2, 2024

@snazy: I don't think there is an issue here. New MetastoreLock is created for every commit operation, and they are not reused or shared.

@snazy
Copy link
Member Author

snazy commented Jul 2, 2024

@pvary hm - but why's there a "lock" and "unlock" operation, if it's not shared?
The comment in lock() says it is shared though: avoid concurrent commit attempts to the same table.
If it is shared, it has concurrency issues:

  • race on jvmLock field between releaseJvmLock() and acquireJvmLock
  • visibility issue of the jvmLock field

@pvary
Copy link
Contributor

pvary commented Jul 2, 2024

The cache is shared, but the lock attribute of the MetastoreLock is not shared.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants