vapor / postgres-nio

🐘 Non-blocking, event-driven Swift client for PostgreSQL.
https://api.vapor.codes/postgresnio/documentation/postgresnio/
MIT License
304 stars 70 forks source link

Fix crash in PoolStateMachine+ConnectionGroup when closing connection while keepAlive is running #444

Closed lovetodream closed 6 months ago

lovetodream commented 7 months ago

Fixes: #443

codecov-commenter commented 7 months ago

Codecov Report

Merging #444 (e0438af) into main (54f491c) will increase coverage by 0.10%. The diff coverage is 88.88%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #444 +/- ## ========================================== + Coverage 59.72% 59.82% +0.10% ========================================== Files 124 124 Lines 9889 9915 +26 ========================================== + Hits 5906 5932 +26 Misses 3983 3983 ``` | [Files](https://app.codecov.io/gh/vapor/postgres-nio/pull/444?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vapor) | Coverage Δ | | |---|---|---| | [Sources/ConnectionPoolModule/ConnectionPool.swift](https://app.codecov.io/gh/vapor/postgres-nio/pull/444?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vapor#diff-U291cmNlcy9Db25uZWN0aW9uUG9vbE1vZHVsZS9Db25uZWN0aW9uUG9vbC5zd2lmdA==) | `94.42% <100.00%> (+1.59%)` | :arrow_up: | | [...nPoolModule/PoolStateMachine+ConnectionState.swift](https://app.codecov.io/gh/vapor/postgres-nio/pull/444?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vapor#diff-U291cmNlcy9Db25uZWN0aW9uUG9vbE1vZHVsZS9Qb29sU3RhdGVNYWNoaW5lK0Nvbm5lY3Rpb25TdGF0ZS5zd2lmdA==) | `84.89% <100.00%> (+0.29%)` | :arrow_up: | | [...ources/ConnectionPoolModule/PoolStateMachine.swift](https://app.codecov.io/gh/vapor/postgres-nio/pull/444?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vapor#diff-U291cmNlcy9Db25uZWN0aW9uUG9vbE1vZHVsZS9Qb29sU3RhdGVNYWNoaW5lLnN3aWZ0) | `88.82% <80.00%> (+0.15%)` | :arrow_up: | | [...nPoolModule/PoolStateMachine+ConnectionGroup.swift](https://app.codecov.io/gh/vapor/postgres-nio/pull/444?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vapor#diff-U291cmNlcy9Db25uZWN0aW9uUG9vbE1vZHVsZS9Qb29sU3RhdGVNYWNoaW5lK0Nvbm5lY3Rpb25Hcm91cC5zd2lmdA==) | `88.05% <89.47%> (-0.48%)` | :arrow_down: | ... and [3 files with indirect coverage changes](https://app.codecov.io/gh/vapor/postgres-nio/pull/444/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vapor)
fabianfett commented 6 months ago

Thanks @lovetodream. Great catch and great fix!