vapor / async-kit

Sugary extensions for the SwiftNIO library
MIT License
71 stars 25 forks source link

Timeout connection requests when in a deadlock. #67

Closed MrLotU closed 4 years ago

MrLotU commented 4 years ago

Fixes a bug when requesting n+1 connections from a connection pool with limit n where each new connection waited on the previous one.

Previously, this would create a deadlock. Now, a timeout can be added to EventLoopConnectionPool, that will return a failed future if the timeout is reached. Timeout defaults to 10 seconds but can be configured. Fixes #63

codecov-commenter commented 4 years ago

Codecov Report

Merging #67 into master will increase coverage by 0.10%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #67      +/-   ##
==========================================
+ Coverage   94.66%   94.76%   +0.10%     
==========================================
  Files          23       23              
  Lines        1180     1204      +24     
==========================================
+ Hits         1117     1141      +24     
  Misses         63       63              
Flag Coverage Δ
#unittests 94.76% <100.00%> (+0.10%) :arrow_up:
Impacted Files Coverage Δ
...ncKit/ConnectionPool/EventLoopConnectionPool.swift 94.82% <100.00%> (+0.28%) :arrow_up:
.../ConnectionPool/EventLoopGroupConnectionPool.swift 93.06% <100.00%> (+0.06%) :arrow_up:
Tests/AsyncKitTests/ConnectionPoolTests.swift 90.23% <100.00%> (+0.69%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 8e2cad8...cb9a97f. Read the comment docs.

tanner0101 commented 4 years ago

These changes are now available in 1.2.0