Bug 3463 - "hg status ." aborts when a transient file in the working directory is deleted
Summary: "hg status ." aborts when a transient file in the working directory is deleted
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: earlier
Hardware: PC Linux
: normal bug
Assignee: Bugzilla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-18 13:54 UTC by Shlomi Fish
Modified: 2012-07-29 14:46 UTC (History)
2 users (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Shlomi Fish 2012-05-18 13:54 UTC
Hi,

I am running Mageia Linux 2 on x86-64 with mercurial-2.1.1-1.mga2 . I have run a fuzz test for a queue implementation that offloads frames (= sequences of several items) to the hard-disk, and so constantly creates files and deletes them, and now I'm getting this when I run "hg status .":

shlomif[fcs]:$trunk/fc-solve/source$ hg --traceback status .
Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py", line 87, in _runcatch
    return _dispatch(req)
  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py", line 683, in _dispatch
    cmdpats, cmdoptions)
  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py", line 465, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py", line 737, in _runcommand
    return checkargs()
  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py", line 691, in checkargs
    return cmdfunc()
  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py", line 680, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
  File "/usr/lib64/python2.7/site-packages/mercurial/util.py", line 456, in check
    return func(*args, **kwargs)
  File "/usr/lib64/python2.7/site-packages/mercurial/commands.py", line 5260, in status
    opts.get('subrepos'))
  File "/usr/lib64/python2.7/site-packages/mercurial/localrepo.py", line 1373, in status
    listclean, listunknown)
  File "/usr/lib64/python2.7/site-packages/mercurial/dirstate.py", line 703, in status
    listignored).iteritems():
  File "/usr/lib64/python2.7/site-packages/mercurial/dirstate.py", line 623, in walk
    entries = listdir(join(nd), stat=True, skip=skip)
OSError: [Errno 2] No such file or directory: '/home/shlomif/progs/freecell/hg/fc-solve/fc-solve/source/queue-offload-dir/fcs_queue_0000000000000046BB0B.page'
abort: No such file or directory: /home/shlomif/progs/freecell/hg/fc-solve/fc-solve/source/queue-offload-dir/fcs_queue_0000000000000046BB0B.page

I was told to report it here by the people on #mercurial on Freenode, so there you go.

Regards,

-- Shlomi Fish
Comment 1 Matt Mackall 2012-05-18 15:26 UTC
This is apparently happening in osutil.listdir, around line 352. We should simply skip files that give ENOENT.
Comment 2 Matt Mackall 2012-05-18 15:35 UTC
Fixed queued for stable
Comment 3 Matt Mackall 2012-07-29 14:46 UTC
Fixed in 2.2.3 by:

6476a21337a6 osutil: handle deletion race with readdir/stat