Skip to content

SqlCommands with connections are not garbagecollected, just disposed. #3471

@jarlrasm

Description

@jarlrasm

Akka.Persistence.Sql.Common.Journal.SqlJournal is using a single CancellationToken for all db-operations, that is only disposed on shutdown, if I understand the code correcly. This indirectly keeps references to all SqlCommands, which again have references to connections and so on, preventing GC. I believe this can be fixed with creating a new CancellationTokenSource with CreateLinkedTokenSource for each command, however I am not quite sure why the implementation is as it is, so I would like to have some feedback from the developers before I fix it and create a pullrequest.

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