github.com/swiftstack/ProxyFS@v0.0.0-20210203235616-4017c267d62f/docs/source/architecture/uml/retryrpc-send.uml (about) 1 @startuml 2 3 title RetryRPC Send - Happy Path 4 5 autonumber 6 7 box Client 8 participant Send 9 participant sendToServer 10 participant notifyReply 11 participant readReplies 12 end box 13 box Server 14 participant run 15 participant serviceClient 16 participant processRequest 17 end box 18 19 Send -> run:dial() server 20 run -> run:Accept connection 21 run -> run:Wait for uniqueID on socket 22 Send -> run:Send uniqueID on socket 23 Send -> readReplies:Start readReplies goroutine 24 25 run -> run:Read uniqueID of new client 26 run -> run:Call getClientIDAndWait()\nif new uniqueID create entry in perClientInfo\notherwise drain RPCs on old connection 27 run -> serviceClient:Start serviceClient goroutine for new client connection 28 29 Send -> sendToServer:Pkg request, assign\nrequestID goroutine to send.\nWait on channel for\nresponse 30 31 sendToServer -> serviceClient: Write hdr and then write\npayload on socket to server 32 note left: retransmit() if write of\nhdr or payload fails 33 34 serviceClient -> processRequest: Read hdr and payload.\nGoroutine to process RPC 35 36 processRequest -> processRequest: Unmarshal RPC, call RPC,\nmarshal response. 37 38 processRequest -> readReplies: Write header\nand then payload to client 39 note left: retransmit() if write of\nhdr or payload fails 40 41 readReplies -> readReplies: Read header and then\npayload off socket.\nCall goroutine to notify\nsender 42 43 readReplies -> notifyReply:Unmarshal response.\nWrite response on\nchannel to sender. 44 note left: retransmit() if unmarshal of\nhdr or payload fails 45 46 Send -> Send:See response on channel and\nreturn response to caller. 47 48 @enduml