-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Labels
bugan unexpected problem or unintended behavioran unexpected problem or unintended behavior
Description
Issue
filelock-unix.c; file descriptor "filedes" is not closed if no lock is received (due to timeout or SIGINT). This can cause a bunch of files to be left open if using filelock through an interactive shell (R, rstudio, etc..)
Reproduce
session 1:
$ R --vanilla
> library(filelock)
> lock("/tmp/test.lck")
Lock on ‘/tmp/test.lck’
lsof:
$ lsof | grep "test.lck"
R 2504 jacobs 3u REG 0,53 0 2393006 /tmp/test.lck
session 2:
$ R --vanilla
> library(filelock)
> lock("/tmp/test.lck",timeout=1)
NULL #<-- timeout, as expected
lsof:
# at this point I'd expect there to still only be 1 open file but...:
$ lsof | grep "test.lck"
R 11476 jacobs 3u REG 0,53 0 2393006 /tmp/test.lck
R 17162 jacobs 3u REG 0,53 0 2393006 /tmp/test.lck
Workaround
The workaround I am currently using for this can be found here:
#master...kdee-korreyd:closefile
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugan unexpected problem or unintended behavioran unexpected problem or unintended behavior