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

server: Verify that .lock fd matches on-disk file #632

Merged
merged 2 commits into from
Jul 13, 2023

Conversation

YaLTeR
Copy link
Contributor

@YaLTeR YaLTeR commented Jun 22, 2023

Fixes a race condition that can happen if one thread unlinks the .lock between our open() and flock() calls.

@codecov
Copy link

codecov bot commented Jun 22, 2023

Codecov Report

Patch coverage: 72.72% and project coverage change: -0.04 ⚠️

Comparison is base (c032dd8) 73.38% compared to head (cd1157d) 73.34%.

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

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #632      +/-   ##
==========================================
- Coverage   73.38%   73.34%   -0.04%     
==========================================
  Files          47       47              
  Lines        7672     7680       +8     
==========================================
+ Hits         5630     5633       +3     
- Misses       2042     2047       +5     
Flag Coverage Δ
main 58.75% <0.00%> (-0.07%) ⬇️
test-- 78.30% <72.72%> (-0.07%) ⬇️
test--server_system 61.46% <72.72%> (-0.03%) ⬇️
test-client_system- 69.27% <72.72%> (-0.05%) ⬇️
test-client_system-server_system 51.45% <72.72%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
wayland-server/src/socket.rs 46.73% <72.72%> (-0.88%) ⬇️

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

YaLTeR added a commit to YaLTeR/wl-clipboard-rs that referenced this pull request Jun 23, 2023
wayland-rs 0.30 is a major API redesign. This commit ports
wl-clipboard-rs to use it. As a bonus, it fixes
#1: the tests are now
fully robust†. As an extra bonus, it adds several randomized
property-based tests.

Since this is a pretty major rewrite, I also took this opportunity to
move to a more standard rustfmt config (Block indent style, default max
width).

Resolves #36.

†: the tests can currently fail due to a race condition in wayland-rs,
which will be automatically fixed when
Smithay/wayland-rs#632 is merged.
@elinorbgr
Copy link
Member

Sorry for the late review. Thanks, this looks good. Could you just add a changelog entry for this?

Fixes a race condition that can happen if one thread unlinks the .lock
between our open() and flock() calls.
@YaLTeR YaLTeR force-pushed the fix-listening-socket-race branch from 31a1fd4 to cd1157d Compare July 13, 2023 11:57
@YaLTeR
Copy link
Contributor Author

YaLTeR commented Jul 13, 2023

Done.

@elinorbgr elinorbgr merged commit a6c5daa into Smithay:master Jul 13, 2023
13 checks passed
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.

2 participants