Concurrence issue in SelectableBiDirectionalQueue (package com.refinitiv.eta.valueadd.common) from t

Hi,


I am using the Java ETA API (https://github.com/Refinitiv/Real-Time-SDK/tree/master/Java). I think there is an issue with the way the _readLock and _writeLock are handled in the class SelectableBiDirectionalQueue (package com.refinitiv.eta.valueadd.common).

Indeed, on the method read() (respectively write()) the _readLock (respectively the _writeLock) is locked. There is a finally clause that unlock the locks, however in case of an IOException, the shutdown method is called. This method will set to null the two respective locks. So if a thread was waiting on the lock, then it will never be able to continue its execution further. Moreover the other thread that sets the lock to null will run into a NullPointerException while executing the finally clause.

Best regards,
Marjorie.

Best Answer

  • @marjorie.mercadier

    Thank you so much for sharing your finding.

    You are correct. It could be a problem.

    You can submit this issue directly to the development team via GitHub. After that, the development will verify this problem and then fix the code.

Answers