[PATCH] tests: remove seemingly unnecessary "sleep 3"
Jim Meyering
jim at meyering.net
Wed Oct 6 21:02:27 UTC 2010
Jeff Darcy wrote:
> On 10/06/2010 11:53 AM, Jeff Darcy wrote:
>> On 10/06/2010 11:51 AM, Jim Meyering wrote:
>>> Is your file system ext4?
>>
>> On the host, yes. The guest mounts my repo directory via sshfs, and I
>> run from there. I suspect that the error mapping might be an sshfs
>> oddity, but that the underlying problem is not.
sshfs! That explains it.
> I wasn't able to reproduce this "live" even by running continuously for
> a couple of hours, but I was able to reproduce the exact same symptom by
> "forgetting" to kill the mongod process in cleanup(). Below is the most
> relevant part of the strace output; 21905 is the mongod process, 22322
> is the test shell. It definitely is returning EPERM when it seems like
> it should succeed (the files are gone) or return ENOTEMPTY (the mongod
> process still has its cwd there). Interestingly, the exact same test
> run on a local (loopback) filesystem doesn't get EPERM even if we leave
> mongod running. It just hangs on exit instead.
>
> I think the "kill -9" change is probably sufficient here. If it turns
> out not to be, well, we'll just have to cross that bridge when we get there.
>
> 21905 select(7, [5 6], NULL, NULL, {0, 10000} <unfinished ...>
> 22322 <... unlinkat resumed> ) = 0
> 22322 close(5) = 0
> 22322 unlinkat(4, "mongod", AT_REMOVEDIR) = -1 EPERM (Operation not
Thanks for investigating.
That looks just like the old SysV "misfeature" (HPUX has it)
that would prohibit one from unlinking a running executable.
But on HPUX it would fail with EBUSY. From Linux's unlink(2):
EBUSY (not on Linux)
The file pathname cannot be unlinked because it is being
used by the system or another process and the implementa-
tion considers this an error.
This suggests it's an sshfs driver bug.
> permitted)
> 22322 write(2, "rm: ", 4) = 4
> 22322 write(2, "cannot remove `/root/repo/t/gt-r"..., 55) = 55
> 22322 write(2, ": Operation not permitted", 25) = 25
> 22322 write(2, "\n", 1) = 1
> 22322 newfstatat(4, "repl.out", {st_mode=S_IFREG|0744, st_size=11, ...},
> AT_SYMLINK_NOFOLLOW) = 0
> 22322 unlinkat(4, "repl.out", 0) = 0
> 22322 close(4) = 0
> 22322 close(0) = 0
> 22322 close(1) = 0
> 22322 close(2) = 0
> 22322 exit_group(1) = ?
> 21821 <... wait4 resumed> [{WIFEXITED(s) && WEXITSTATUS(s) == 1}], 0,
> NULL) = 22322
> 21905 <... select resumed> ) = 0 (Timeout)
More information about the iwhd-devel
mailing list