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

Chia-Chuan Ho commented on HDDS-16335:
--------------------------------------

Hi [~szetszwo] 
I took an initial look at XceiverClientShortCircuit and would like to check my 
understanding before starting the change.
 
Would it make sense to use a single lock to coordinate connection 
initialization, the open check and request write, and the close transition? The 
receiver and callers waiting for responses would remain outside the lock. This 
should still allow multiple requests to be in flight, while keeping request 
frames serialized and preventing close() from racing with socket writes and 
timeout registration.
 
My current understanding is that this client is intended to use a one-shot 
connection, since the receiver daemon cannot be restarted. I would therefore 
keep repeated connect() idempotent while the connection is open, and reject 
reconnect attempts after failure or close.
 
I am also considering making the request/response counters safe for 
cross-thread access and letting the receiver use stable references to the 
socket and timer. For coverage, I would extend the existing short-circuit 
integration test with concurrent connect(), Echo requests using distinct call 
IDs, and concurrent close().
 
I noticed a related issue around exact-once cleanup and pending metrics when 
the connection fails. To keep this patch focused, I was thinking of handling 
that separately, unless you think it belongs in this Jira.
 
Does this approach sound reasonable, or is there another synchronization model 
you had in mind?
Thanks!

> Change XceiverClientShortCircuit to support concurrent access
> -------------------------------------------------------------
>
>                 Key: HDDS-16335
>                 URL: https://issues.apache.org/jira/browse/HDDS-16335
>             Project: Apache Ozone
>          Issue Type: Sub-task
>          Components: Ozone Client
>            Reporter: Tsz-wo Sze
>            Priority: Major
>
> In XceiverClientShortCircuit, domainSocket and some other fields are not 
> synchronized.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to