Skip to content

AwaitableSender: error if connection is lost while sending a message #109

@safer-bwd

Description

@safer-bwd

Describe the bug

Error if connection is lost (ConnectionEvents.disconnected) while sending(AwaitableSender.send()) a message.

Log:

[2023-12-05T08:42:37.775Z] DEBUG message 9f21de77-7abd-4849-a2d2-a3f4c025c59e is sending…
[2023-12-05T08:42:42.019Z] INFO connection 'connection-1' disconnected. Error: read 
ECONNRESET
    at TCP.onStreamRead (internal/stream_base_commons.js:209:20) {
  errno: -4077,
  code: 'ECONNRESET',
  syscall: 'read'
}

TypeError: Cannot read property 'address' of undefined
    at AwaitableSender.get address [as address] (\node_modules\rhea-promise\dist\lib\link.js:63:28)
    at Timeout._onTimeout (\node_modules\rhea-promise\dist\lib\awaitableSender.js:133:69)
    at listOnTimeout (internal/timers.js:557:17)
    at processTimers (internal/timers.js:500:7)

Expected behavior
This case should not crash the application.

Package-version: 3.0.1
node.js version: 14.21.3
OS name and version: any

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions