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

Ghost clients #113

Closed
vgb0332 opened this issue Jan 7, 2022 · 4 comments
Closed

Ghost clients #113

vgb0332 opened this issue Jan 7, 2022 · 4 comments

Comments

@vgb0332
Copy link

vgb0332 commented Jan 7, 2022

Hi, first I want to thank you for this library. It's awesome! saving a lot of time :)

There are 2 issues I'm having at the moment.

  1. V8 Memory Burst
  2. Unknown leftover clients

I'm using the library in Express, where I create one or more instances(already logged in) on HTTP requests, and after finishing with clients, close them accordingly by client.close().

For example,

router.get('/', async (req, res) => {
var key = getApiKeyFromDB()
var client1 = new Client({...});
//Ater done with client1, close
await client1.close();
...
var client2 = new Client({...});
...
await client2.close();
});

I haven't REALLY tested the problems and how they occur yet (can't find stable error patterns)
But, for issue 1, executing multiple client methods like in a loop, Express crashes throwing bunch of V8 errors, and restart.
For issue 2, in most cases, I think I properly close all the clients, but there are cases where there are yet unknown clients hanging around in the server, or unintentionally crashing into a same client from other processes like node-scheduler.

The memory issue I currently have no idea with it.
But for ghost clients, I wonder if there is a way to check for clients (like client list?) so another process can reuse or close.

@Roma-Kyrnis
Copy link

Roma-Kyrnis commented Jan 26, 2024

Hi, have you found a solution?

@Bannerets
Copy link
Owner

I don't understand this issue and how all of that is possible, but I welcome a reproducible example.

@vgb0332
Copy link
Author

vgb0332 commented Feb 8, 2024

Hi, have you found a solution?

It's been so long i'm not sure if I remember clearly, but
issues came from

  1. Memory shortage - each client holds quite some memory while alive.
  2. Zombie processes - I later optimized the clients session by handling globally throughout all common processes.

Hope they help.

@Bannerets
Copy link
Owner

Open a new issue if you encounter anything like that (on the latest version).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants