Duplex stream timeout by AWS when step debugging

0

Using NodeJS LTS 18.12 with Rascal 16.1.2 as the AMQP third party library

I like step debugging, as opposed to littering the code with console.log() (though logpoints are a thing). The problem is that I get this error when pausing with a breakpoint. This is because a timeout is exceeded somewhere when pausing.

Unexpected close
    at path\node_modules\amqplib\lib\connection.js:165:32
    at path\node_modules\amqplib\lib\connection.js:159:12
    at TLSSocket.recv (path\node_modules\amqplib\lib\connection.js:507:12)
    at Object.onceWrapper (node:events:627:28)
    at TLSSocket.emit (node:events:513:28)
    at emitReadable_ (node:internal/streams/readable:590:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:81:21)

Investigation reveals that the thing that is being closed is a duplex stream in amqplib. For a stream to close, one of the parts have to explicitly call stream.end().

Rascal only closes the stream when the initial connection times out. Once a connection has been established, timeouts are disabled. That's why I'm sure the error lies in AWS ending the stream.

The AMQP protocol implements heartbeats. On the client, I have disabled heartbeat timeout. However, it may be that heartbeats are sent from the server to the client, to which the client cannot respond (because it's stuck in pausing).

Is there a way to extend the timeout of an Amazon MQ connection in any way for debugging purposes?

asked a year ago47 views
No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions