Skip to content

client could set a flag when close() is called #1

@jordanhendricks

Description

@jordanhendricks

Today I spent a long time debugging a hanging program using the mahi client. The result of this investigation was that I inadvertently used the client after it had been closed. Restify's http agent, the default agent for the node-mahi client, is configured using keep alive. As a result, there was an extra socket open after the program's work had finished, resulting in the process hanging for 2 minutes or so until it timed out. (This socket was never cleaned up, as close() had already been called on the client.)

It would be nice if the client set a flag on itself when the close() method is invoked and return an error (or perhaps fail an assertion) on other methods if the client has been marked as closed.

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