Skip to content

Conversation

@pattyshack
Copy link

(on behalf of @msolo) inotify fd should not leak to children processes (this matches the kqueue implementation behavior).

@msolo
Copy link

msolo commented Oct 5, 2016

Thanks for submitting this. Been on my list of things to push back for over a year.

@pattyshack
Copy link
Author

Looks like the project's travis config is broken (the linter doesn't build in go 1.5). Otherwise, the change seems fine

@nathany
Copy link
Contributor

nathany commented Oct 5, 2016

I merged #175. Want to rebase and give this another go on Travis?

@pattyshack pattyshack closed this Oct 5, 2016
@pattyshack pattyshack deleted the close-on-exec branch October 5, 2016 02:25
Copy link
Contributor

@nathany nathany left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Patrick.

I'm not 100% sure on the InotifyInit1 change yet -- we may need some people with ARM and IBM Power devices to look at it first.

Is it possible to deflake the test independently and come back to the close-on-exec change, or is that necessary for deflakery?

func NewWatcher() (*Watcher, error) {
// Create inotify fd
fd, errno := unix.InotifyInit()
fd, errno := unix.InotifyInit1(syscall.IN_CLOEXEC)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to be careful with this change, possibly testing it manually as Travis CI doesn't give us coverage of arm and ppc64 architectures that fsnotify currently supports.

Copy link
Contributor

@nathany nathany Oct 5, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hoping the Go team will help us out with that, but I'm not sure when they'll have time. golang/go#17312

}
}()
doneChan := make(chan struct{})
errChan := make(chan error, 1000)
Copy link
Contributor

@nathany nathany Oct 5, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this channel need to be buffered?

errChan <- fmt.Errorf("Remove failed: %v", err)
}

time.Sleep(time.Millisecond)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious why the 1ms sleep is needed.

Copy link
Contributor

@nathany nathany Oct 5, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This stress test is pretty lengthy, so it might be nice to add a few more comments for future maintainers.

@pattyshack
Copy link
Author

(i totally messed up my branch. will send another pull request)

@nathany
Copy link
Contributor

nathany commented Oct 5, 2016

Both locally and your remote? 😢
Sorry, I guess I did ask you to rebase on master. Darn rebase.

A new PR is fine by me though.

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

Successfully merging this pull request may close these issues.

3 participants