Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Executing release on InterProcessLock from cygwin yields: The argument must be an int or have a fileno method. #72

Closed
nodiex-cloud opened this issue Jun 8, 2021 · 7 comments

Comments

@nodiex-cloud
Copy link

nodiex-cloud commented Jun 8, 2021

Hello, I (with duplicity the backup soft) am using fastener from cygwin and creating a lock with InterProcessLock. When releasing the lock I am receiving the above error.

  1. What is the intended behavior of fastener on cygwin?
  2. Is cygwin suppose to behave like a POSIX filesystem or is the expected interaction with the file system for C/Python programs running in cygwin through the Win APIs?
@psarka
Copy link
Collaborator

psarka commented Jun 8, 2021

Interesting, could you, please, paste the full stacktrace?

@nodiex-cloud
Copy link
Author

nodiex-cloud commented Jun 8, 2021

Sure, this is what I am getting:

('Could not unlock the acquired lock opened on `%s`', b'/cg/j/restore_dest_5/data/elv_main/lockfile')
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/fasteners/process_lock.py", line 166, in release
    self.unlock()
  File "/usr/local/lib/python3.8/site-packages/fasteners/process_lock.py", line 193, in unlock
    self._unlock(self.lockfile)
  File "/usr/local/lib/python3.8/site-packages/fasteners/process_lock.py", line 430, in _unlock
    fcntl.lockf(lockfile, fcntl.LOCK_UN)
TypeError: argument must be an int, or have a fileno() method.

@shoop
Copy link

shoop commented Jun 8, 2021

I see the same trace from duplicity 0.8.19 built with fasteners 0.16.1, at the end of every run.
This is on a Linux host, duplicity run from within a container based on docker.io/library/python:3.9.5-slim.
The volume /archive is mounted from a ZFS filesystem in the container.

('Could not unlock the acquired lock opened on `%s`', b'/archive/firsa_home_b2/lockfile')
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/fasteners/process_lock.py", line 166, in release
    self.unlock()
  File "/usr/local/lib/python3.9/site-packages/fasteners/process_lock.py", line 193, in unlock
    self._unlock(self.lockfile)
  File "/usr/local/lib/python3.9/site-packages/fasteners/process_lock.py", line 430, in _unlock
    fcntl.lockf(lockfile, fcntl.LOCK_UN)                                       
TypeError: argument must be an int, or have a fileno() method.                

@psarka
Copy link
Collaborator

psarka commented Jun 12, 2021

@nodiex-cloud @shoop I cannot replicate this, could you please provide an example I could run and a bit more details about your environment?

I myself tried cygwin on windows 10 with python36 and python36-venv installed as cygwin packages. I then ran the tests for the process lock and they all pass.

Also, 0.16.1 was an errorneous release (my screw up, appologies for that!), could you please try with 0.16.2 or with master?

@shoop
Copy link

shoop commented Aug 17, 2021

Hi @psarka , sorry for the delay in response. I can confirm that with fasteners 0.16.3 the problem has gone away for me.

@psarka
Copy link
Collaborator

psarka commented Aug 17, 2021

Great, thanks!

@psarka
Copy link
Collaborator

psarka commented Jan 17, 2022

Note: I found the root cause of this issue (see #82), and it has nothing to do with cygwin. Fasteners on cygwin run fine, and I would like them to continue to run fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants