-
-
Notifications
You must be signed in to change notification settings - Fork 115
Use the rc package for refcounting inside the implementation of Client. #515
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This makes the implementation of Promise.Resolve a bit cleaner.
...called clientCursor. Step 1 in a broader refactoring.
We now use the rc package. There are some test failures that need to be pinned down.
Tests seem to expect this to still be good.
With an initially null Client, the client pointer is nil so this field doesn't even exist.
This fixes a number of tests, but not all of them.
We no longer have a bunch of call sites that need to do other things with the locked value, so let's just acquire it inside the function and simplify the heck out of how this is used.
...as well as naming it as such; there's no other misc. clientHookState data, it's all promise resolution.
...just inline it into compress; there's no other logic in there anyway.
newClientCursor was a bit too hard to read.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, actually reviewed for real this time. LGTM overall, but requesting a small clarification.
...which isn't entirely trivial.
We always pass this around in a mutex anyway, so just move that inside the struct like everything else that has synchronized state.
Trying to record outstanding issues:
|
Fixed the client leak. |
Fixes a leak. I'm not sure why this worked before the rc refactor.
I went ahead and updated the weakrefs test. I'm still a little stumped on TestDuplicateBootstrap, and am getting frustrated. I'm tempted to suggest merging this with the failure in place (maybe marking the test as flaky); the bug seems less serious than the one we're on track to fix, so maybe punt it until later. |
Per some discussion on matrix, the way weakrefs interact with promise resolution has changed, but I don't think we actually care, so this just changes the test to match.
As Louis pointed out, this is a bit weird, and I'm not sure why I changed it.
This builds on top of #502, #508, and #509. There are still some failing tests, so I'm marking this as a draft, but it's close enough that it's probably worth a look.