-
Notifications
You must be signed in to change notification settings - Fork 150
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
ZiplineScoped initial plumbing #773
Conversation
Previously it was a member of OutboundCallHandler, but this caused OutboundHandler to transitively reach the ZiplineService, which broke leak detection.
I think this shook out a bug in our JS leak detection. I’ve introduced a reference cycle that involves the object we’re tracking (the outbound service) and its scope, and I suspect it’s unsafe to run code in this situation. To avoid the cycle I’d need to limit what the scope knows. That might be okay.
|
if (closed) return | ||
closed = true | ||
|
||
val servicesCopy = services.toTypedArray() // Because ZiplineService.close() mutates the set. |
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.
What about calling services.clear()
here so that the calls to remove()
are a no-op rather than wastefully doing a bunch of set ops?
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.
Oooooh I like. Done.
* Do not extend this in your [ZiplineService] interfaces; it should only be implemented by concrete | ||
* implementation classes. |
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.
Can the compiler validate this? At least on dealing with calls to take
walk its interface hierarchy and validate none do this.
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.
Absolutely. On the list.
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.
No description provided.