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

Change file descriptor to be blocking. #4

Merged
merged 5 commits into from
Feb 3, 2019
Merged

Conversation

nkirsch
Copy link
Contributor

@nkirsch nkirsch commented Feb 2, 2019

This appears to be changed via the go runtime, as we need to set the file descriptor type prior to each read call.

gather seems to function the same in go1.8 or go 1.11.

@nkirsch nkirsch self-assigned this Feb 2, 2019
@nkirsch nkirsch requested review from Setheck and tqorange February 2, 2019 00:14
@@ -41,6 +41,7 @@ func getRawFtraceChan(fp FileProvider, cpu int, doneCh <-chan bool) (<-chan []by

for {
var buf = make([]byte, syscall.Getpagesize())
syscall.SetNonblock(int(f.(*os.File).Fd()), false)
Copy link

Choose a reason for hiding this comment

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

👍

@@ -41,6 +41,7 @@ func getRawFtraceChan(fp FileProvider, cpu int, doneCh <-chan bool) (<-chan []by

for {
var buf = make([]byte, syscall.Getpagesize())
syscall.SetNonblock(int(f.(*os.File).Fd()), false)
Copy link

Choose a reason for hiding this comment

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

Is this all we need? I thought I tried this out. Then Reading
golang/go#22939 and https://go-review.googlesource.com/c/go/+/100077/13
I was under the impression we needed to change the os.Open in file.go to something closer to os.NewFile then make the call to syscall.SetNonblock (golang/go#22939 (comment))

@nkirsch
Copy link
Contributor Author

nkirsch commented Feb 2, 2019 via email

@nkirsch nkirsch changed the title Disable non-blocking socket. Change file descriptor to be blocking. Feb 2, 2019
Setheck and others added 2 commits February 2, 2019 10:26
…d pipes as non-blocking - and we ultimately want to force blocking behavior.
@nkirsch nkirsch merged commit 9dae3ea into master Feb 3, 2019
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