[ 
https://issues.apache.org/jira/browse/ASTERIXDB-3346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17812405#comment-17812405
 ] 

ASF subversion and git services commented on ASTERIXDB-3346:
------------------------------------------------------------

Commit 1319480d43225deb2d972fc2cce949b28714ec5b in asterixdb's branch 
refs/heads/master from Wail Alkowaileet
[ https://gitbox.apache.org/repos/asf?p=asterixdb.git;h=1319480d43 ]

[ASTERIXDB-3346][MTD] Fix GlobalResourceIdFactory race cond.

- user model changes: no
- storage format changes: no
- interface changes: no

Details:
Creating a new ID can wait in indefinitely due to
a race condition (see ASTERIXDB-3346) for more details.

Change-Id: Ic7ff15abbc70277a9f1ae340314335253aa23308
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/18144
Reviewed-by: Wail Alkowaileet <[email protected]>
Reviewed-by: Ali Alsuliman <[email protected]>
Tested-by: Jenkins <[email protected]>
Integration-Tests: Wail Alkowaileet <[email protected]>


> Race condition in GlobalResourceIdFactory
> -----------------------------------------
>
>                 Key: ASTERIXDB-3346
>                 URL: https://issues.apache.org/jira/browse/ASTERIXDB-3346
>             Project: Apache AsterixDB
>          Issue Type: Bug
>          Components: MTD - Metadata
>    Affects Versions: 0.9.9
>            Reporter: Wail Y. Alkowaileet
>            Assignee: Wail Y. Alkowaileet
>            Priority: Major
>             Fix For: 0.9.9
>
>
> In 
> [GlobalResourceIdFactory:|https://github.com/apache/asterixdb/blob/30d1fa121c926434504d7c3691338cd28bf5aa0e/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/transaction/GlobalResourceIdFactory.java#L41]
> {noformat}
>             // if there already exists a response, use it
>             ResourceIdRequestResponseMessage response = 
> resourceIdResponseQ.poll();
>             if (response == null) {
>                 requestNewBlock();
>                 response = resourceIdResponseQ.take();
>             } {noformat}
> Two threads say (t1 and t2) can have a race condition:
> t1: do *requestNewBlock();*
> t2: poll the response of the request of t1 ({*}resourceIdResponseQ.poll(){*})
> t1: waits for the response in *resourceIdResponseQ.take()* indefinitely 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to