Skip to content

Golang filter: add callback method for http plugin config destruction #38557

@hypnoce

Description

@hypnoce

Title: destroy go config explicitly using a callback to ensure go config lifecycle is bound to the C++ config lifecycle

Description:
Config created by a golang tcp or http filter can hold state or resources that need to be freed.
While it is technically possible to register the config object in gc finalizer, it breaks the idea of the config lifecycle in envoy.

The idea would be to introduce a Config interface with a Destroy function, and assert on the config type to call Destroy.

Let me know if that's something that you find useful.

I noticed that other golang plugins have different semantic regarding config and filter lifecycle. I was mainly focused on the http plugin.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions