You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by GitBox <gi...@apache.org> on 2022/07/13 19:57:54 UTC

[GitHub] [tinkerpop] simonz-bq commented on pull request #1754: gremlin-go: fix deadlock on (*DriverRemoteConnection).Close

simonz-bq commented on PR #1754:
URL: https://github.com/apache/tinkerpop/pull/1754#issuecomment-1183620876

   @jroimartin, correct me if I'm wrong, but another deadlock can occur here. Let's call them user for invoked `close` and readLoop for error-caused `close`.
   
   1. `readLoop` errors and calls the `errorCallback`, which in turn calls `close`
   2. `readLoop` holds the `close` lock
   3. `readLoop` finishes closing, releases the `close` lock, goes back to the loop, and invokes `Done()` before returning
   5. user holds the `close` lock
   6. user waits for the waitgroup
   
   There is a race condition here where we assume step 6 happens before step 3 finishes.
   
   I *think* this can be solved by saving the `closed` state before to a variable, and then checking that && wait to solve this.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org