impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Behm (Code Review)" <>
Subject [Impala-ASF-CR] IMPALA-4449: Revisit table locking pattern in the catalog
Date Thu, 19 Jan 2017 21:01:41 GMT
Alex Behm has posted comments on this change.

Change subject: IMPALA-4449: Revisit table locking pattern in the catalog

Patch Set 2:

File fe/src/main/java/org/apache/impala/catalog/

Line 184:   private static final long TIMEOUT_FOR_TBL_LOCK_IN_MSEC = 3600000;
We usually use the MS suffix elsewhere, i.e.,


I think we should consider making this higher and/or even configurable (in a separate patch).

Line 187:    * Tries to acquire a table lock while holding the catalogLock_. Returns true
if it
Tries to acquire the catalogLock_ and the lock of 'tbl' in that order.

Line 205:       Thread.yield();
I believe this will call sched_yield() on Linux, so may still end up with busy-spinning-like
behavior or at least unpredictable "waiting" times. What's wrong with Thread.sleep()?
File fe/src/main/java/org/apache/impala/catalog/

Line 72:   private final ReentrantLock tableLock_ = new ReentrantLock(true);
Thinking about this a little more: Why does this lock need to be fair? We don't really wait
for it and instead we have a try+retry loop.

I'm mostly asking because forcing fairness could mislead readers if that feature is not really

I think preventing starvation with a try+retry approach will be hard.

To view, visit
To unsubscribe, visit

Gerrit-MessageType: comment
Gerrit-Change-Id: Id08e21da31deb1f003b3cada4517651f3b3b2bb2
Gerrit-PatchSet: 2
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Dimitris Tsirogiannis <>
Gerrit-Reviewer: Alex Behm <>
Gerrit-Reviewer: Bharath Vissapragada <>
Gerrit-Reviewer: Dan Hecht <>
Gerrit-Reviewer: Dimitris Tsirogiannis <>
Gerrit-Reviewer: Marcel Kornacker <>
Gerrit-HasComments: Yes

View raw message