Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug with application of max idle time #176

Merged
merged 7 commits into from Mar 6, 2023
Merged

Fix bug with application of max idle time #176

merged 7 commits into from Mar 6, 2023

Conversation

davidmoten
Copy link
Owner

@davidmoten davidmoten commented Mar 6, 2023

As discussed in #41, if concurrent actions have ensured that the pool has N connections (N > 1) and there are >=N single threaded actions using the pool before max idle time is reached then despite the fact that only 1 connection at a time has been used since the pool expanded to N no connections are timed out and released.

This was because a FIFO queue was used to gather checked-in connections which brought about round-robin behaviour. The fix is to switch to using a LIFO queue.

@codecov
Copy link

codecov bot commented Mar 6, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.19 🎉

Comparison is base (8a82d7e) 77.54% compared to head (2d02ac4) 77.73%.

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #176      +/-   ##
============================================
+ Coverage     77.54%   77.73%   +0.19%     
- Complexity      660      668       +8     
============================================
  Files            73       74       +1     
  Lines          2725     2744      +19     
  Branches        226      229       +3     
============================================
+ Hits           2113     2133      +20     
  Misses          509      509              
+ Partials        103      102       -1     
Impacted Files Coverage Δ
...ain/java/org/davidmoten/rx/internal/LifoQueue.java 100.00% <100.00%> (ø)
...main/java/org/davidmoten/rx/pool/MemberSingle.java 91.66% <100.00%> (ø)
.../java/org/davidmoten/rx/pool/DecoratingMember.java 95.55% <0.00%> (+2.22%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant