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

Fix Start ctx expiration making app unstoppable #1017

Merged
merged 1 commit into from
Jan 9, 2023

Commits on Jan 9, 2023

  1. Fix Start ctx expiration making app unstoppable

    This fixes uber-go#1015.
    
    When Start() is called, it passes StartTimeout to the relayer
    goroutine, which is monitoring the Stop signal, as well as the
    OS signal handler.
    
    It then exits the goroutine if the start context expires, which
    would naturally happen if the user uses the default setting (15s
    timeout) or any finite amount of timeout value.
    
    This causes the app to then be not responsive to any OS signals
    such as SIGTERM or SIGINT.
    
    This was a regression introduced in 1.19 release.
    
    To fix this, this commit simply removes the relayer goroutine
    from selecting on the start context being completed.
    
    Verified that all tests are still passing without any goroutine
    leak, except one test that was triggering a panic to test the
    panic handler.
    
    To prevent that one test from opting out every single test into
    goleak.VerifyNone(t) in every sub test, I pulled out that panic
    test into a separate test package so that we can continue to
    use goleak.VerifyNone() method in app_test.
    sywhang committed Jan 9, 2023
    Configuration menu
    Copy the full SHA
    b36c345 View commit details
    Browse the repository at this point in the history