Skip to content

Synchronous channel cleanup #3064

@harendra-kumar

Description

@harendra-kumar

We throw ThreadAbort exception to running thread when the channel is stopped. Asynchronous exceptions can cause inadvertent problems because of unclean shutdown of the thread. It may leave the system in inconsistent state unless proper exception handling is implemented by the programmer. To avoid such issues we can also use a synchronous shutdown of streams by setting a flag and letting the thread abort itself. This would stop the thread before the next item in the stream is handled but the current action would not be interrupted. This could lead to delays in aborting the streams but would be safer than async signalling. This could be a config option, perhaps the default and the programmer can choose the other way if needed.

We can also have an option of a hybrid approach where we try to stop the threads synchronously first then after a timeout throw async exceptions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions