avito-tech / go-transaction-manager

Transaction manager for GoLang
MIT License
214 stars 12 forks source link

kinda goroutine leak with pgx module in awaitDone #105

Open Olex1313 opened 1 month ago

Olex1313 commented 1 month ago

Hello, I've been using trm for my personal projects with pgx backend and found out some edge case in trm/v2/manager.go.

Apparently, when a context with external cancel function is passed in Manager.Do, the pgx implementation of a transaction relies on context either have no Done channel or getting the cancel function from manager.

It is kinda fixed in #103 due to changes inside transaction implementations, but the latest release version v2.0.0-rc8 released before it and when I vendor the v2.0.0-rc8 it still contains leak, maybe I am doing something wrong?

Khranovskiy commented 1 month ago

Hello, there are two PRs that fix known memory-related problems:

I have to take several days to check if release v2.0.0-rc8 contains the same fix as 103.