Page MenuHomePhabricator

dirstateguard: use mktemp-like functionality to generate the backup filenames
ClosedPublic

Authored by spectral on Apr 20 2021, 4:08 PM.

Details

Summary

Previously these were generated with names like:
dirstate.backup.commit.<memory address of dirstateguard>

This could cause problems if two hg commands ran at the same time that used the
same memory address, (which is apparently not uncommon if chg is involved), as
memory addresses are not unique across processes.

This issue was reported in the post-review comments on
http://phab.mercurial-scm.org/D9952.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

spectral created this revision.Apr 20 2021, 4:08 PM

Thanks for following up, I couldn't trigger it on one pipeline run, which is a good sign (on top of the patch making sense to me).

However, this breaks test-check-code.t and changes the output of test-fncache.t and test-inherit-mode.t.

Alphare requested changes to this revision.Apr 21 2021, 11:54 AM
This revision now requires changes to proceed.Apr 21 2021, 11:54 AM
spectral updated this revision to Diff 27163.Apr 26 2021, 10:01 PM

I thought I'd run the entire test suite and it passed before sending. Sorry about that! Fixed fncache and inherit-mode by not writing out the narrowspec backup in the mkstemp call. I'm not getting any failures in test-check-code.t, can you share what ones you're seeing?

Alphare accepted this revision.Apr 29 2021, 10:57 AM

I thought I'd run the entire test suite and it passed before sending. Sorry about that! Fixed fncache and inherit-mode by not writing out the narrowspec backup in the mkstemp call. I'm not getting any failures in test-check-code.t, can you share what ones you're seeing?

Black was complaining, so I fixed it in flight. This landed on the stable branch, since we've cut a release since then.

This revision is now accepted and ready to land.Apr 29 2021, 10:57 AM
This revision was not accepted when it landed; it landed in state Needs Review.
This revision was automatically updated to reflect the committed changes.