2
0
Commit Graph

124 Commits

Author SHA1 Message Date
Jan Dubsky 58f94f0470 Add test for release after acquire 2022-10-28 18:20:03 -05:00
Jan Dubsky 4fbc609092 Add banchmarks with cancelled acquires 2022-10-28 18:20:03 -05:00
Jan Dubsky 47b52af713 Add acquire benchmarks 2022-10-28 18:20:03 -05:00
Jack Christensen f6fee6af77 Release v2.0.1 2022-10-28 18:11:10 -05:00
Jack Christensen d344a18fdb Add to the destructWG wait group while cond.L is locked
Otherwise, if many constructors are underway while the pool is closed it
is possible destructWG will get to 0 while the Wait in Close is underway
and then Add will be called again which is disallowed.

From the docs:

Note that calls with a positive delta that occur when the counter is
zero must happen before a Wait.

https://github.com/jackc/pgx/issues/1356
2022-10-27 20:46:47 -05:00
Jack Christensen 2ccdbf199a Release v2.0.0 2022-09-17 08:48:15 -05:00
Jack Christensen 0f8cbb548a Update changelog 2022-09-03 13:12:44 -05:00
Jack Christensen 1b5d140faa Pull in v1 changelog 2022-09-03 13:12:03 -05:00
Jack Christensen 30b2cb627e Replace interface{} with any 2022-09-03 13:10:10 -05:00
Jack Christensen fdc2381cbe Do not cancel resource construction when Acquire is canceled
https://github.com/jackc/pgx/issues/1287
https://github.com/jackc/pgx/issues/1259
2022-09-03 13:08:12 -05:00
Jack Christensen 98e0d10515 Soften the policy of not accepting feature and performance changes 2022-09-03 11:47:11 -05:00
Jack Christensen b1aadee38e NewPool takes Config
This allows for backwards compatible additions. No features are planned
but this would make it easier if they are added.
2022-09-03 11:45:07 -05:00
James Hartig f63192c063 Fix race with background Acquire creation 2022-08-27 18:02:55 -05:00
James Hartig da694536ff Create resources in the background in Acquire 2022-08-27 07:47:02 -05:00
Jack Christensen 4ec26629b3 Replace Travis CI with Github Actions CI 2022-08-27 07:27:21 -05:00
Jack Christensen f5fa474129 Update changelog 2022-07-30 12:22:16 -05:00
Jack Christensen 6b44286e08 Add Reset() 2022-07-30 12:12:56 -05:00
Jack Christensen 2c6a3a9afd Move to v2 2022-07-30 12:12:43 -05:00
Jack Christensen d91b446b0e Tweak status message 2022-07-30 12:12:22 -05:00
Jack Christensen 2ef4b3d22a Upgrade testify 2022-07-30 11:27:56 -05:00
Jack Christensen 40069f25d6 Remove compat layer and use generics directly
Backwards compatibility is not required since moving to v2.
2022-07-30 11:26:33 -05:00
Столяров Владимир Алексеевич 4e95984946 Move main logic to package and use generics for API with backwards compatibility 2022-04-04 07:56:16 -05:00
Jack Christensen 314357b795 Add status to readme 2022-01-14 18:02:39 -06:00
Jack Christensen 2c7aa6e146 Release v1.2.1 2021-12-02 18:02:13 -06:00
Jack Christensen 8fac9a91a4 Restore 100% test coverage 2021-12-02 18:00:10 -06:00
Jack Christensen ba6bef1563 TryAcquire does not overfill pool 2021-12-02 18:00:10 -06:00
Jack Christensen 8f8e2d8cfa Add TryAcquire to stress test 2021-12-02 18:00:10 -06:00
Jack Christensen 69f945a21a Merge doAcquire back into Acquire 2021-12-02 18:00:10 -06:00
Jack Christensen 021a5cc1a6 TryAcquire created resource in background instead of blocking
refs #14
2021-12-02 18:00:10 -06:00
Jack Christensen 228d0e587b Release v1.2.0 2021-11-20 09:48:15 -06:00
Jack Christensen 4d33264d63 Do not leave pool lock after panic from nil context
refs #13
2021-11-13 17:39:29 -06:00
Alexander Staubo 69a4c02937 Fix several memory leaks caused by modifying a slice length without
removing the elements from the backing array.
2021-11-13 04:51:43 -06:00
Jack Christensen 0cff23235f Merge pull request #11 from ajjensen13/feature-try-aquire
Add TryAcquire and ErrNotAvailable
2021-09-25 09:33:18 -05:00
A. Jensen cac2b5a858 Add TryAcquire and ErrNotAvailable
Fixes https://github.com/jackc/puddle/issues/10
2021-09-20 20:16:07 -05:00
Jack Christensen ad77d7b935 Release v1.1.4 2021-09-11 11:17:26 -05:00
Dmitriy Matrenichev aa0e8cd5bc Fix deadlock in Pool.CreateResource 2021-09-11 02:15:45 +03:00
Jack Christensen f196d0d9f9 Release v1.1.3 2020-12-03 19:09:11 -06:00
Evgeny Vanslov 513cb84ff5 Ensure that conditional variable is signaled if resource failed to create 2020-12-03 19:14:39 +00:00
Jack Christensen 8a2237ffa5 Merge pull request #6 from yasushi-saito/master
Clarify the meanings of Stats accessors
2020-10-05 08:59:19 -05:00
Yaz Saito dd3aa6a6bc Update the phrasing of TotalResources. 2020-10-03 23:04:50 -07:00
Yaz Saito a70fb082df Clarify the meanings of Stats accessors 2020-09-28 07:53:01 -07:00
Jack Christensen 6eeab89f3c Release v1.1.2 2020-09-26 11:05:58 -05:00
Jack Christensen 91d0159cc9 Fix crash when pool is closed when resource is being created
Also, restore 100% test coverage.
2020-08-20 21:58:10 -05:00
Jack Christensen 6d0ef02e90 Fix: Resource.Destroy removed self from pool after destructor complete 2020-08-20 21:56:47 -05:00
Jack Christensen 6706e16fc2 Release v1.1.1 2020-04-02 22:18:14 -05:00
Jack Christensen 558756d6c4 Fix race condition when CreateResource is called concurrently with Close
WaitGroup.Add(1) cannot be called after WaitGroup.Wait().
2020-04-02 22:11:33 -05:00
Jack Christensen 7cc1dd1985 CreateResource checks if pool is closed before any action 2020-04-02 22:11:22 -05:00
Jack Christensen 69489dce36 AcquireAllIdle immediately returns nil if pool is closed 2020-04-02 22:10:53 -05:00
Jack Christensen 2cd0ce3f9b Closing a closed pool is a no-op 2020-04-02 22:10:13 -05:00
Jack Christensen fc71d04d41 Release v1.1.0 2020-02-05 11:00:40 -06:00