A new experimental feature of SQLite uses a blocking posix lock at one point. I have a test case where a process is blocked in this fcntl() call on OSX, but I can't see why. The same test works on Linux, but that could just be lucky timing.
The call is:
fcntl(fd, F_SETLKW, &f);
where "f" is:
$1 = {
l_start = 120,
l_len = 1,
l_pid = 0,
l_type = 3,
l_whence = 0
}
According to [lsof] my process is the only one that has the file open:
bash-3.2$ sudo lsof test.db-shm
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
testfixtu 21393 dan 10u REG 14,2 32768 228781731 test.db-shm
It is possible that some other process was holding a conflicting lock when fcntl() was first called though.
gdb shows that the file descriptor being passed to fcntl() is "10", so I think it is valid.
So my question is, why might fcntl() be blocking if no other processes have the file open?
Aucun commentaire:
Enregistrer un commentaire