transform-hub
transform-hub copied to clipboard
Fix reconnect logging and memleak
What?
- Fix the logging levels on reconnect from the runner
- Unhook streams before reconnecting an instance
Why?
Currently a reconnect causes a double call to hookupStreams
which pipes multiple streams to the input. This unhooks the streams on reconnect, so there are no extra listeners and we're not causing a refleak.
This only happens when a sequence stream errors out.
Additionally stream connect and reconnect errors are muted while connecting and logging happens only on disconnection.
Reproduce:
- Create an instance that sends an error on output (
out.emit("error", new Error())
) - Observe the chain of reconnects
Review checks:
These aspects need to be checked by the reviewer:
- [ ] Verify and confirm operation (please post a screenshot)
- [ ] All STH tests pass
- [ ] All Scramjet Cloud Platform tests pass
- [ ] Documentation is updated or no changes
We need to double check if an error in sequence does kill it.
EDIT: fixed it.
It does not break the existing functionalities of Reconnect. Side note: it did not fix https://app.clickup.com/t/86944kkf4