Wail Y. Alkowaileet created ASTERIXDB-3346:
----------------------------------------------

             Summary: 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
             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