Skip to content
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

chore (client): expose a close method on the ElectricNamespace to dispose its resources #703

Merged
merged 4 commits into from
Nov 29, 2023

Conversation

kevin-dp
Copy link
Contributor

This PR addresses the first task of #243.
As suggested, the ElectricNamespace (and thus also the ElectricClient as it extends the namespace) now exposes a close method that can be called by the user to dispose all resources used by the Electric client. This close method calls the stop on the global registry such that it also stops the client's satellite process.

Copy link

linear bot commented Nov 28, 2023

VAX-971 client: Leaky resources (Notifier subscriptions, EventEmitter listeners...)

Here I list some places in the client code which leak subscriptions to the notifier, as they are never cleared up. These are the ones we found while working on the Dart client.

Copy link
Contributor

@balegas balegas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing this. A couple of suggestions:

  • Maybe we should have a lifecycle test for electric testing that a process is registered after the electrification and deregistered after close. I'm not sure how much code is available to test this, but if not low-hanging I'm happy to skip
  • Please double check that the things that are allocated for a process are all de-allocated and that we're not leaking any resources, or not de-registering from global stuff. This might have been the last thing, but let's do another pass before closing [VAX-971] client: Leaky resources (Notifier subscriptions, EventEmitter listeners...) #243.

@kevin-dp kevin-dp force-pushed the kevindp/vax-971-dispose-connectivity-listener branch from 1b806f5 to e11d59a Compare November 29, 2023 07:51
Copy link
Contributor

@balegas balegas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for looking into suggestions

@kevin-dp kevin-dp merged commit fb773fb into main Nov 29, 2023
6 checks passed
@kevin-dp kevin-dp deleted the kevindp/vax-971-dispose-connectivity-listener branch November 29, 2023 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants