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

Issue in NetFlow processor stop logic #40

Closed
raghurampai opened this issue Sep 10, 2019 · 1 comment
Closed

Issue in NetFlow processor stop logic #40

raghurampai opened this issue Sep 10, 2019 · 1 comment

Comments

@raghurampai
Copy link

Noticed an issue in NetFlow decoder's stop logic which can result in-
fatal error: all goroutines are asleep - deadlock!

Below is the issue described in decoders/decoder.go code-

func (w Worker) Start() {   
	go func() {  
		//log.Debugf("Worker %v started", w.Id)  
		for {  
			// w.WorkerPool <- w.InMsg  -- Issue commented  
			select {  
			case <-w.Quit:  
				break  
			// case msg := <-w.InMsg:  -- Issue commented  
			case w.WorkerPool <- w.InMsg:  // -- Fix added  
			        msg := <-w.InMsg    // -- Fix added  
                                timeTrackStart := time.Now()  

Go playground for quick check-
https://play.golang.org/p/LnDFz8vT_4G

Thanks!

@lspgn
Copy link
Contributor

lspgn commented Sep 30, 2019

Thanks @raghurampai for the report.
Made a PR for the fix. Will test.

lspgn added a commit that referenced this issue Sep 30, 2019
Fix for #40: change the position of the channel
@lspgn lspgn closed this as completed Sep 30, 2019
tgragnato pushed a commit to tgragnato/goflow that referenced this issue Aug 14, 2024
* Allow Flow Routines to be cancellable
tgragnato pushed a commit to tgragnato/goflow that referenced this issue Aug 14, 2024
In d1e1ace ("Allow Flow Routines to be cancellable (cloudflare#40)"), the
payload was passed to another goroutine and erased by the next packet
to be received if the goroutine did not process it fast enough. Make
a copy before passing it to the goroutine to fix that.
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