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

nyagos shutdowns slowly when terminal's close button is pressed. #410

Closed
hymkor opened this issue Jun 1, 2021 · 3 comments
Closed

nyagos shutdowns slowly when terminal's close button is pressed. #410

hymkor opened this issue Jun 1, 2021 · 3 comments
Assignees
Labels

Comments

@hymkor
Copy link
Collaborator

hymkor commented Jun 1, 2021

According to the report from @nocd5 :

The executable built by go1.15 shutdowns enough fast , but, the one by go1.16 does too slow.

@hymkor
Copy link
Collaborator Author

hymkor commented Jun 1, 2021

@hymkor hymkor self-assigned this Jun 1, 2021
@hymkor
Copy link
Collaborator Author

hymkor commented Jun 1, 2021

I run this program and see Got signal: terminated and after some seconds, the terminal closes.

package main

import (
	"os"
	"os/signal"
	"fmt"
	"time"
)

func main() {
	println("Ok")
	for {
		c := make(chan os.Signal, 1)
		signal.Notify(c)

		s := <-c
		time.Sleep(time.Second) // ** ADDED THIS **
		fmt.Println("Got signal:", s)
	}
}

On runtime: handling of CTRL_CLOSE_EVENT seems broken · Issue #41884 · golang/go

you'll never see the Got signal: terminated (with Go 1.15.6, my patch fixes this).

hymkor added a commit that referenced this issue Jun 1, 2021
hymkor added a commit that referenced this issue Jun 1, 2021
@hymkor
Copy link
Collaborator Author

hymkor commented Jun 1, 2021

it shutdowns faster by removing syscall.SIGTERM from signal.Ignore(os.Interrupt, syscall.SIGINT, syscall.SIGTERM)

@hymkor hymkor added the bug label Jun 1, 2021
@hymkor hymkor closed this as completed Jun 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant