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

macOS Big Sur: Retry file open when error is EINTR #354

Closed
hiro-tan opened this issue Nov 19, 2020 · 0 comments · Fixed by #475
Closed

macOS Big Sur: Retry file open when error is EINTR #354

hiro-tan opened this issue Nov 19, 2020 · 0 comments · Fixed by #475
Labels

Comments

@hiro-tan
Copy link

hiro-tan commented Nov 19, 2020

Which operating system (GOOS) and version are you using?

macOS: Big Sur 11.0.1
Machine detail: MacBook Pro (13-inch, 2020, Four Thunderbolt 3 ports), CPU: 2.3 GHz Quad Core Intel Core i7

Please describe the issue that occurred.

I upgrade macOS then unix.Open sometimes return error interrupted system call.
So when process reached https://github.com/fsnotify/fsnotify/blob/master/kqueue.go#L218 and error is EINTR, I want to retry file open.
This like below:

// This is another issue, but unix.Open return 2^32 - 1 as file descriptor when some error is occurred in my environment.
for watchfd == 0 || watchfd == -1 || watchfd == 4294967295 {
	watchfd, err = unix.Open(name, openMode, 0700)
	if (watchfd == -1 || watchfd == 4294967295) && err != unix.EINTR {
		return "", err
	}
}

But I can't decide if this is an effect of upgrading macOS or a problem in my environment.
Give me your opinion, please.

arp242 added a commit that referenced this issue Jul 29, 2022
Retry the unix.Open() if the error returned is EINTR; looking around the
web it seems many systems handle it like this. This is also what
os.Open() does:
golang/go@50d0ee0

Fixes #354
@arp242 arp242 added the bug label Jul 29, 2022
arp242 added a commit that referenced this issue Jul 29, 2022
Retry the unix.Open() if the error returned is EINTR; looking around the
web it seems many systems handle it like this. This is also what
os.Open() does:
golang/go@50d0ee0

Fixes #354
arp242 added a commit that referenced this issue Jul 30, 2022
Retry the unix.Open() if the error returned is EINTR; looking around the
web it seems many systems handle it like this. This is also what
os.Open() does:
golang/go@50d0ee0

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

Successfully merging a pull request may close this issue.

2 participants