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

Guarantee run-id uniqueness #2196

Merged
merged 2 commits into from
Jul 5, 2023
Merged

Conversation

osctobe
Copy link
Contributor

@osctobe osctobe commented Jun 15, 2023

The first patch improves on run-id generation to make it guaranteed to be unique on a running machine.
Second removes wrapping tests in an empty netns that was working around the lack of run-id uniqueness.

test/zdtm_ct.c Show resolved Hide resolved
criu/util.c Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Jun 21, 2023

Codecov Report

Patch coverage: 71.42% and project coverage change: +0.04 🎉

Comparison is base (1e90fc8) 70.48% compared to head (c5ce9eb) 70.53%.

❗ Current head c5ce9eb differs from pull request most recent head f29797c. Consider uploading reports for the commit f29797c to get more accurate results

Additional details and impacted files
@@             Coverage Diff              @@
##           criu-dev    #2196      +/-   ##
============================================
+ Coverage     70.48%   70.53%   +0.04%     
============================================
  Files           133      133              
  Lines         33508    33514       +6     
============================================
+ Hits          23619    23638      +19     
+ Misses         9889     9876      -13     
Impacted Files Coverage Δ
criu/util.c 64.38% <71.42%> (-0.06%) ⬇️

... and 4 files with indirect coverage changes

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

Instead of relying on chance of CLOCK_MONOTONIC reading being unique,
use pid namespace ID that combined with the process ID will make it
unique on the machine level.

If pidns is not enabled on a kernel we'll get ENOENT, but then CRIU's
pid will already be unique. If there is some other error, log it but
continue, as the socket clash (if it happens) will result in a failed
run anyway.

Fixes: 45e048d (2022-03-31 "criu: generate unique socket names")
Fixes: 408a7d8 (2022-02-12 "util: add an unique ID of the current criu run")
Change-Id: I111c006e1b5b1db8932232684c976a84f4256e49
Signed-off-by: Michał Mirosław <emmir@google.com>
With the parasite socket clash now guaranteed not to happen,
the comment becomes obsolete. netns is steel needed though, so
update the comment to point at the requirement.

Change-Id: I3cfb253cd5c53b91b955fcb001530b4aee5129f4
Signed-off-by: Michał Mirosław <emmir@google.com>
@avagin avagin merged commit 4c2b71c into checkpoint-restore:criu-dev Jul 5, 2023
34 of 38 checks passed
@osctobe osctobe deleted the run-id-uniq branch July 18, 2023 17:20
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

3 participants