Skip to content

servient.shutdown does not close open http connections #1506

Description

@relu91

As stated in #1503 (comment):

The hard thing is that await servient.shutdown(); should also work (instead of using the subscription object and stopping it). However, it does not close the subscription as it only calls HTTPFactory destroy -> which does nothing. Probably this is a separate issue, and this one can be closed once the example is updated as above.

A trivial solution could be to keep a reference to the HTTP client created in the HTTPFactory and close it when it is destroyed. But I noticed that we are currently caching clients also at the ConsumeThing level, which is a little bit counterintuitive as it should be the binding to decide what and when to cache. Probably a proper review of the current core -> protocol bindings interaction pattern is needed before closing this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions