Commit graph

1629 commits

Author SHA1 Message Date
93eac06fd6 Update Guile Knots 2024-12-29 11:05:07 +00:00
62d6b59013 Make build_servers.id just generated by default
As to make it easier to set explicitly.
2024-12-15 20:54:11 +00:00
73b53f46a3 Add utility functions for configuring the database 2024-12-15 20:17:10 +00:00
8b49884816 Use knots
A library of extracted Guile Fibers patterns and utilities.
2024-12-15 20:17:10 +00:00
a33e32275e Add a comment 2024-12-09 10:53:06 +00:00
d7c7f74ff1 Log differently when using the load-new-guix-revision-inserts lock 2024-12-09 10:53:06 +00:00
859b0093f8 Avoid getting the load-new-guix-revision-inserts lock twice 2024-12-09 10:53:06 +00:00
62fc9b7225 Fix hash display for formatted derivations 2024-12-09 10:53:06 +00:00
5664cde17c Improve some query formatting 2024-12-09 10:53:06 +00:00
ba97dfc1fe Fix wrong number of values from channel-derivations-by-system->guix-store-item 2024-12-09 10:53:06 +00:00
5ed98343d7 Rework loading revision data
These changes were motivated by switching to a mechanism of loading data that
isn't dependent on the big advisory lock that prevents more than one revision
from being processed at a time.

Since INSERT ... RETURNING id; is used, this can block if another transaction
inserts the same data, and then cause an error when that transaction
commits. The solution is to use ON CONFLICT DO NOTHING, but you have to handle
the case when the INSERT doesn't return an id since the other transaction has
inserted it.

This commit rewrites insert-missing-data-and-return-all-ids to do as described
above, as well as being more efficient in how existing data is detected and to
use more vectors. Other utilities for inserting data are added as well.
2024-12-09 10:53:06 +00:00
b128e9bd7a Improve null handling 2024-12-01 22:56:12 +00:00
bb84e45c42 Handle conflicts in insert-missing-data-and-return-all-ids 2024-12-01 22:56:12 +00:00
c949deb9d4 Memoize field-can-be-null? 2024-11-29 14:06:08 +00:00
930169751c Handle conflicts when inserting lint warning message sets 2024-11-29 14:06:08 +00:00
9a38374e7c Use insert-missing-data-and-return-all-ids for locations 2024-11-29 14:06:08 +00:00
221394eafb Add in call-with-worker-thread to try to avoid sort problems 2024-11-29 13:49:38 +00:00
cb1bc060c8 Move log message 2024-11-29 10:37:56 +00:00
e14fd88d8f Don't lookup #f in the hash table 2024-11-29 10:09:41 +00:00
64aeeffd8e Insert guix_revision_package_derivation_distribution_counts later
As this should speed up processing revisions.
2024-11-26 14:12:17 +00:00
620ac16e26 Don't crash when linters crash
This is currently happening because some linters try to evaluate parts of
packages for cross-building to aarch64-linux-gnu, but not all packages support
that and some crash in this case.

I'm not quite sure what the correct behaviour should be, but maybe the data
service needs to try and handle these crashes rather than not processing the
entire revision.
2024-11-26 09:27:50 +00:00
112bc95a13 Restore calling update-derivation-ids-hash-table!
In derivation-file-names->derivation-ids. This is important for performance
since it avoids reading derivations with an entry already in the database.
2024-11-25 10:56:01 +00:00
bda4269b56 Change to logging the filtered derivations
As that's what's relevant here.
2024-11-25 10:55:45 +00:00
84e78ef3ed Stop queries being able to insert systems 2024-11-13 09:55:03 +00:00
e7ada1bada Allow using the heap profiler in the inferior 2024-11-08 22:34:28 +00:00
ebeb4212ff More efficiently create some vectors
And instrument the inferior memory after creating the gds-inferior-packages
vector.
2024-11-08 22:34:28 +00:00
ca5f0036f3 Add a heap-profiler module
Taken from a Guile mailing list post.
2024-11-08 22:34:28 +00:00
0c1e9ad4e4 Do more when cleaning inferiors
Not sure if this actually helps, but it might do.
2024-11-08 12:59:08 +00:00
7ffe82dfe3 Add log-tag when inserting channel instance derivations 2024-11-08 12:54:14 +00:00
58af8e2dc7 Fix git-commit-exists? 2024-11-08 12:52:48 +00:00
3f07df510e Fix sorting license sets 2024-11-08 12:52:29 +00:00
c58ee6726b Fix starting with an empty database 2024-11-08 12:52:18 +00:00
717b861d31 Have the background resource pool users be very patient 2024-11-05 09:41:46 +00:00
6bf1747f55 Always assume that resource pool waiters will stick around
As I think this is a more efficient design.
2024-11-05 09:41:30 +00:00
d310632f26 Move the inferior cleanup to the end of each system+target 2024-11-04 08:40:45 +00:00
cee8868bfd Refactor 2024-11-03 21:24:24 +00:00
ed6a4b1577 Use a separate db connection in channel-derivations-by-system-promise
As this can run in parallel with something else using conn.
2024-11-02 09:35:23 +00:00
6265c37e89 Increase the sleep-operation time for telling waiters to retry
As this being too short was leading call-with-resource-pool to get stuck.
2024-10-31 20:04:16 +00:00
e67edf54bc Finish chasing the call-with-resource-pool bug
This took a while to find as process-job would just get stuck, and this wasn't
directly related to any particular change, just that more fibers increased the
chance of hitting it.

This commit includes lots of the things I changed while debugging.
2024-10-31 20:04:16 +00:00
af93bdcf5e Tweak the resource pool return behaviour
If there's lots of contention for the resource pool, there will be lots of
waiters, so telling all of them to retry whenever a resource is returned seems
wasteful. This commit adds a new option (assume-reliable-waiters?) which will
have the resource pool try to give a returned resource to the oldest waiter,
if this fails, it'll go back to the old behaviour of telling all waiters to
retry.
2024-10-31 16:46:43 +00:00
de5e036ab1 Ensure that call-with-resource-from-pool doesn't get stuck
As I think this was happening when it missed the resource-pool-retry-checkout
reply from the resource pool. Handle this case by periodically retrying with a
configurable timeout.
2024-10-31 16:45:09 +00:00
2d7100e75d Add call-with-default-io-waiters
As this is useful when starting threads from a fibers context.
2024-10-31 16:44:15 +00:00
55af7c82e8 Add new fibers utilities
The new fibers-map uses the same batching approach that fibers-for-each uses,
and fibers-map-with-progress allows tracking on the results while the map is
happening.
2024-10-31 16:43:13 +00:00
f8ac6e3dd9 Add make-queueing-channel
From the build coordinator.
2024-10-31 16:42:42 +00:00
1782a33a18 Add a comment 2024-10-27 14:39:52 +00:00
c650fc6e7a Rework inserting derivations
To add more parallelism.
2024-10-27 14:39:52 +00:00
1e0407e9b6 Use a common derivation-ids-hash-table
To allow for calling derivation-file-names->derivation-ids in parallel across
multiple fibers, using the PostgreSQL connection fiber to perform atomic
operations.
2024-10-27 14:39:52 +00:00
38d5501233 Add placeholder derivation source file nar procedures 2024-10-27 14:39:52 +00:00
ff32aa899e Include the package version in the "error when computing" messages
As this helps when there are lots of packages with the same name.
2024-10-27 14:39:52 +00:00
052cf7580c Ensure the guix derivations are stored prior to attempting to substitute 2024-10-27 14:39:52 +00:00