transform-hub icon indicating copy to clipboard operation
transform-hub copied to clipboard

Fix reconnect logging and memleak

Open MichalCz opened this issue 3 months ago • 2 comments

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

MichalCz avatar Mar 20 '24 23:03 MichalCz