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

Unblock connection receive when context is done #781

Merged
merged 1 commit into from
Jul 18, 2022

Commits on Jul 7, 2022

  1. Unblock connection receive when context is done

    When context is canceled we don't read anymore from `t.incoming` channel
    because the select clause exists on `ctx.Done`. This change adds the
    same behavior to the point where `t.incoming` channel is written.
    Without this the call to `conn.Receive` could block forever given a
    race condition between a context cancellation and a new incoming
    message.
    
    Furthermore, is always a good practice to listen to `context.Done` on
    blocking points where a context variable is available.
    
    Signed-off-by: Iñigo Garcia Olaizola <11333576+igolaizola@users.noreply.github.com>
    igolaizola committed Jul 7, 2022
    Configuration menu
    Copy the full SHA
    4cec1cf View commit details
    Browse the repository at this point in the history