>From Michael Blow <[email protected]>:

Attention is currently required from: Ali Alsuliman.

Michael Blow has posted comments on this change by Ali Alsuliman. ( 
https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/22013?usp=email )

Change subject: [NO ISSUE][API] Mark index DDL requests running
......................................................................


Patch Set 1:

(1 comment)

File 
asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/BaseClientRequest.java:

https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/22013/comment/19993a07_b721bd43?usp=email
 :
PS1, Line 120:     private ObjectNode putJson() {
putJson() is now the only access of `state` that doesn't hold the monitor, and 
it also reads the non-volatile `cancellable` unlocked. That leaves two gaps:

- cancel() calls complete(), which writes COMPLETED, then writes CANCELLED. 
Both happen under the lock, but an unlocked reader can land between them and 
report a cancelled request as "completed".
- `state` and `cancellable` aren't read as a pair. `cancellable` also has no 
visibility guarantee here at all.

This predates this change, but the change is about making the reported state 
trustworthy. I'd rather pay for the synchronization than keep that window, so 
please make putJson() synchronized. It's only reached from the request listings 
(toJson/asJson/asRedactedJson), so the cost is negligible.

Once that's done, every access of `state` holds the lock, so it can drop 
`volatile` (line 36). `completionTime` should stay volatile, because 
getElapsedTimeMillis() is public and still reads it unlocked.



--
To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/22013?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://asterix-gerrit.ics.uci.edu/settings?usp=email

Gerrit-MessageType: comment
Gerrit-Project: asterixdb
Gerrit-Branch: helios
Gerrit-Change-Id: I34ad2f53e978576fca6890f4923a12fe884ec1c0
Gerrit-Change-Number: 22013
Gerrit-PatchSet: 1
Gerrit-Owner: Ali Alsuliman <[email protected]>
Gerrit-Reviewer: Ali Alsuliman <[email protected]>
Gerrit-Reviewer: Anon. E. Moose #1000171
Gerrit-Reviewer: Jenkins <[email protected]>
Gerrit-Reviewer: Michael Blow <[email protected]>
Gerrit-Reviewer: Murtadha Hubail <[email protected]>
Gerrit-Attention: Ali Alsuliman <[email protected]>
Gerrit-Comment-Date: Thu, 08 Oct 2026 16:14:04 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No

Reply via email to