aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/pool.hh
AgeCommit message (Collapse)Author
2024-04-05Revert "libutil: drop Pool resources on exceptional free"eldritch horrors
This reverts commit de2884b82b376d10de5c400d8e73bc7d98f195d2. Change-Id: I1fa301149d7c2ed3d266a40c15b2d010e12e44e6
2024-04-05Revert "libutil: remove Pool::Handle::bad"eldritch horrors
This reverts commit 792844fb861ea7367ac2316c78fec055363f2f9e. Change-Id: I3ca208b62edfd5cd1199478f75cd2edf19a364f6
2024-04-05Revert "libutil: allow graceful dropping of Pool::Handle"eldritch horrors
This reverts commit 8075541d82d05347321d35b9934ccee5f82142f4. Change-Id: I05fa6a9de1308a4827a6557cf2807eb47ca64da6
2024-03-31libutil: allow graceful dropping of Pool::Handleeldritch horrors
not needed yet, but returning a resource from the exception handling path that has ownership of a handle is currently not well-supported. we could also add a default constructor to Handle, but then we would also need to change the pool reference to a pointer. eventually that should be done since now resources can be swapped between pools with clever moves, but since that's not a problem yet we won't do it now. Change-Id: I26eb06581f7be34569e9e67a33da736128d167af
2024-03-31libutil: remove Pool::Handle::badeldritch horrors
it was used incorrectly (not swapped on handle move), only used in one place (that is now handled with exception handling detection in Handle itself), and if ever reintroduced should be replaced with a different, more understandable mechanism (like an explicit dropAsInvalid method). Change-Id: Ie3e5d5cfa81d335429cb2ee5c3ad85c74a9df17b
2024-03-31libutil: remove Pool::flushBadeldritch horrors
this was never actually used, and bad design in the first place—why should a bad resource be put back into the idle pool? just drop it. Change-Id: Idab8774bee19dadae0209d404c4fb86dd4aeba1e
2024-03-30libutil: drop Pool resources on exceptional freeeldritch horrors
if a scope owning a resource does not gracefully drop that resource while handling exceptions from deeper down the call stack we should assume the resource is invalid state and drop it. currently it *is* true that such cases do not cause resources to be freed, but thanks to validator misuses this has so far not caused any larger problem. Change-Id: Ie4f91bcd60a64d05c5ff9d22cc97954816d13b97
2023-03-31Ensure all headers have `#pragma once` and are in API docsJohn Ericson
`///@file` makes them show up in the internal API dos. A tiny few were missing `#pragma once`.
2023-03-31Extend internal API docs, part 2John Ericson
Picking up from #8111. Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
2018-10-16RemoteStore: Close connection if an exception occursEelco Dolstra
Fixes #2075.
2017-09-14RemoteStore: Add option to drop old connections from the poolEelco Dolstra
This is a hack to make hydra-queue-runner free its temproots periodically, thereby ensuring that garbage collection of the corresponding paths is not blocked until the queue runner is restarted. It would be better if temproots could be released earlier than at process exit. I started working on a RAII object returned by functions like addToStore() that releases temproots. However, this would be a pretty massive change so I gave up on it for now.
2017-04-26Add Store nesting to fix import-from-derivation within filterSourceShea Levy
2017-03-03Pool: Don't hang if creating a connection failsEelco Dolstra
2017-03-03Improve SSH handlingEelco Dolstra
* Unify SSH code in SSHStore and LegacySSHStore. * Fix a race starting the SSH master. We now wait synchronously for the SSH master to finish starting. This prevents the SSH clients from starting their own connections. * Don't use a master if max-connections == 1. * Add a "max-connections" store parameter. * Add a "compress" store parameter.
2016-11-26Revert "Get rid of unicode quotes (#1140)"Eelco Dolstra
This reverts commit f78126bfd6b6c8477fcdbc09b2f98772dbe9a1e7. There really is no need for such a massive change...
2016-11-25Get rid of unicode quotes (#1140)Guillaume Maudoux
2016-02-24std::condition_variable_any -> std::condition_variableEelco Dolstra
The latter is supposed to be more efficient.
2016-02-24C++ templates are just a glorified macro facilityEelco Dolstra
2016-02-24Remove bad daemon connections from the poolEelco Dolstra
This is necessary for long-running processes like hydra-queue-runner: if a nix-daemon worker is killed, we need to stop reusing that connection.
2016-02-23Pool<T>: Allow a maximum pool sizeEelco Dolstra
2016-02-23RemoteStore: Make thread-safeEelco Dolstra
This allows a RemoteStore object to be used safely from multiple threads concurrently. It will make multiple daemon connections if necessary. Note: pool.hh and sync.hh have been copied from the Hydra source tree.