Skip to content

Silence ECONNRESET on stop #900

@hasezoey

Description

@hasezoey

It seems like on .stop after the shutdown command it may be possible that a ECONNRESET Error happens instead of the connection being closed, similar to the already ignored connection 1 to 127.0.0.1:41485 closed message pre mongodb 4.2.

This has been originally reported on discord, where the user notes that this might only happen on replset members, but not single instances.

Example Error:

Error: read ECONNRESET
        at TCP.onStreamRead (node:internal/stream_base_commons:216:20) {
      errno: -4077,
      code: 'ECONNRESET',
      syscall: 'read'
    }

      at node_modules/mongodb-memory-server-core/src/util/MongoInstance.ts:469:23
      at MongoMemoryServer.stop (node_modules/mongodb-memory-server-core/src/MongoMemoryServer.ts:593:5)
          at async Promise.all (index 0)
      at MongoMemoryReplSet.stop (node_modules/mongodb-memory-server-core/src/MongoMemoryReplSet.ts:546:33)

(MMS 10.1.2, binary 7.0.14, windows)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions