-
Notifications
You must be signed in to change notification settings - Fork 80
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
Fix JS client leaking exported references, clarify dh.Widget API #4939
Conversation
bfa7828
to
f4fe85b
Compare
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.
Minor doc correction, couple of questions/comments.
web/client-api/src/main/java/io/deephaven/web/client/api/widget/JsWidget.java
Outdated
Show resolved
Hide resolved
web/client-api/src/main/java/io/deephaven/web/client/api/widget/JsWidgetExportedObject.java
Show resolved
Hide resolved
req.setSourceId(ticket.getTicket()); | ||
req.setResultId(reexportedTicket); | ||
connection.sessionServiceClient().exportFromTicket(req, connection.metadata(), c::apply); | ||
}).then(success -> { |
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.
The downside of this is the extra round trip (not a TicketAndPromise
), but it is a lot cleaner this way.
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.
Oh right - I can make it less clean and less round trippy....
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.
Hmm. I can, but then there will be zero round trips, and we would be ignoring failure (if any) from the exportFromTIcket call, and would only find out after trying to use the resulting object.
In that case, we could stop returning promise entirely.
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.
I'm indifferent. Could file a ticket to optimize this in the future?
This PR is an update to #4909.
JsPartitionedTable, JsFigure, PandasTable were previously being leaked even with correct usage, ensure that those are released when client code calls close(). Additionally, partitioned tables would be re-exported unnecessarily, but only the re-export was released, leaking the original reference.
Widget and WidgetExportedObject had documentation indicating how to consume exported objects, but these rules were not enforced. The rules have changed to be more consistent and are enforced, which should avoid later confusion, and new documentation added to propose potential patterns to follow when authoring plugins.
Fixes #4903