Skip to content

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

@hiro-tan

Description

@hiro-tan

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions