Conversation
This operation is intended to function similar to the "touch" command and will essentially bypass the optimizations which avoid modifying repository metadata when there are no effective changes to it. It is particularly useful for using createrepo-agent to generate initial metadata for an empty repository without seeding it with any packages.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #36 +/- ##
==========================================
+ Coverage 48.97% 49.75% +0.78%
==========================================
Files 20 20
Lines 2638 2705 +67
Branches 538 555 +17
==========================================
+ Hits 1292 1346 +54
- Misses 1039 1044 +5
- Partials 307 315 +8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Generally looks fine to my eyes. Some questions and probably considering add more tests for corner cases: no-valid-architecture argument, no-argument, single architecture passed.
Is this something you plan to add to the code automatically when creating the initial metadata or must be called by the user in a different command? |
|
Other minor problem. If I run mkdir build, cd build, cmake .., make tests there is a problem on smake.touch/bar: Seems like tests must be called from build/tests or running ctest directly? |
|
Thanks for taking a look.
Good call out, I'll add them.
I can't reproduce this. It seems to pass for me when I run The |
I managed to hit this! It's only the Maybe I'll add an explicit CTest fixture that copies the fixtures into the testing directory fresh as part of each invocation. |
9c8a4a0 to
5a53020
Compare
5a53020 to
e47801a
Compare
great, thanks ! I think that I found a segfault happening in the tests. I've asked my debugging agent to investigate the gdb of it and the explanation that it produced sounds reasonable to me although I'm not familiar with the code base to fully verified the claims. Black-box testing the fix worked. The problem
Stack trace from the crash: libxml2's documentation Why only
Why it's non-deterministic: the race only fires when two workers hit the lazy init window at the same time. Single-core scheduling, CPU caches, or cold cache for libxml2's encoding tables all affect the outcome. Why the Python test A possible fixAdded a call to diff --git a/src/createrepo-cache/repo_cache.c b/src/createrepo-cache/repo_cache.c
index 8c279ba..5d2bacb 100644
--- a/src/createrepo-cache/repo_cache.c
+++ b/src/createrepo-cache/repo_cache.c
@@ -424,6 +424,11 @@ cra_cache_new(const char * path)
cra_Cache * cache;
gpgme_error_t rc;
+ // Initialize libxml2 on the main thread. Without this, concurrent first-use
+ // from flush worker threads races on libxml2's lazy global init and crashes
+ // inside xmlDocDumpFormatMemoryEnc. The initialization is idempotent.
+ cr_xml_dump_init();
+
cache = g_new0(cra_Cache, 1);
if (!cache) {
return NULL; |
This operation is intended to function similar to the "touch" command and will essentially bypass the optimizations which avoid modifying repository metadata when there are no effective changes to it.
It is particularly useful for using createrepo-agent to generate initial metadata for an empty repository without seeding it with any packages.
The actual effect of this change happens in
repo_cache.c. All the rest of the changes are plumbing and tests.