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

Wouldn't the source code for "Reset Connection Pool in case of destruction" be a problem? #197

Open
orchsik opened this issue Dec 11, 2024 · 1 comment

Comments

@orchsik
Copy link

orchsik commented Dec 11, 2024

transform.destroy([error])

  • Destroy the stream, and optionally emit an 'error' event. After this call, the transform stream would release any internal resources.
  • Implementors should not override this method, but instead implement readable._destroy().
  • The default implementation of _destroy() for Transform also emit 'close' unless emitClose is set in false.
  • Once destroy() has been called, any further calls will be a no-op and no further errors except from _destroy() may be emitted as 'error'.

[Sources] https://nodejs.org/api/stream.html#transformdestroyerror


"Implementors should not override this method, "

pino-elasticsearch > lib.js

// Resurrect connection pool on destroy
splitter.destroy = () => {
  if (typeof client.connectionPool.resurrect === 'function') {
    client.connectionPool.resurrect({ name: 'elasticsearch-js' })
  }
}

Overriding this method ...
Wouldn't the source code for "Reset Connection Pool in case of destruction" be a problem?

@mcollina
Copy link
Member

Good question. Is it causing any bugs to you?

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

No branches or pull requests

2 participants