Repository navigation
This fixes a leak in cleaning up RpcSessions objects - #69
Conversation
|
This PR also includes the commits from #63. Please rebase onto master. |
fixed |
| // In that case we are either already connected or know we failed to do so, so don't want | ||
| // to mark as connecting. | ||
| if (this.#connecting.has(uri)) { | ||
| this.#connecting.set(uri, newSesh) |
There was a problem hiding this comment.
Does the comment match the code? You say "don't want to make as connecting" but then you go right ahead and set #connecting?
There was a problem hiding this comment.
"that case" is the else-branch afaict (where it is indeed marked as not connecting).
gebner
left a comment
There was a problem hiding this comment.
The whole connected/connecting bookkeeping seems unnecessarily complicated (and error-prone as this PR shows). We could probably get away with a single #sessions map and a connected: Promise<{}> field in RpcSession.
| // In that case we are either already connected or know we failed to do so, so don't want | ||
| // to mark as connecting. | ||
| if (this.#connecting.has(uri)) { | ||
| this.#connecting.set(uri, newSesh) |
There was a problem hiding this comment.
"that case" is the else-branch afaict (where it is indeed marked as not connecting).
I did try this idea when initially implementing |
I think this explains some of the debug output we see after editing lean files for a while.