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

flock hangs #98

Closed
DUOLabs333 opened this issue Dec 10, 2023 · 3 comments
Closed

flock hangs #98

DUOLabs333 opened this issue Dec 10, 2023 · 3 comments

Comments

@DUOLabs333
Copy link
Contributor

While this issue was discovered when trying to debug #91, this is not related to that issue.

If flock is run on a file in an NFS mount, the program hangs.
(Unlike #91, there's a reproducer)

#include <fcntl.h>
#include <sys/mman.h>
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <dlfcn.h>
int main(int argc, char** argv){
	int fd=openat(AT_FDCWD, "test_mount/tmp/gopls-diff-stats-2599980011", O_RDWR);
	printf("%s\n",strerror(errno));
	flock(fd,LOCK_EX);
}
@DUOLabs333
Copy link
Contributor Author

Using nolock solved this.

@willscott
Copy link
Owner

nolock as a mount option, you mean?

@DUOLabs333
Copy link
Contributor Author

Yes.

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

2 participants