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

1628 backport closing monitoring channel #645

Merged
merged 3 commits into from Jul 29, 2021

Commits on Jul 29, 2021

  1. Make closing all the replicas stop all the replica monitors

    The replica monitor channel goroutine is still running when a
    controller's volume is shutdown via the GRPC VolumeShutdown method.
    This change makes stops the Controller's replica monitor goroutine when
    the volume is shutdown.
    
    Signed-off-by: Keith Lucas <keith.lucas@suse.com>
    Keith Lucas committed Jul 29, 2021
    Copy the full SHA
    d769b56 View commit details
    Browse the repository at this point in the history
  2. Add test for removing a replica and recreating it

    Signed-off-by: Keith Lucas <keith.lucas@suse.com>
    Keith Lucas committed Jul 29, 2021
    Copy the full SHA
    5eea6b7 View commit details
    Browse the repository at this point in the history
  3. Stop monitoring goroutine when removing replica

    The monitoring goroutine was continuing to run after the replica was
    removed.  This caused a problem when a replica is recreated for the same
    IP address and port after one is deleted.  When a replica is removed,
    the channel that the monitoring goroutine is waiting for will eventually
    get an error message.  In the normal case, the SetReplicaMode won't find
    a replica with the address to mark as ERR.  However, when another
    replica is with the same address is added after the original was
    removed, SetReplicaMode for the old monitorChan will mark the new
    replica as ERR with SetReplicaMode.
    
    This change makes removing the replica also stop the monitoring
    goroutine that was launched for that replica.  It uses StopMonitoring to
    put a nil error on the replica's monitor channel so monitoring goroutine
    will exit as part of removing the replica.
    
    Signed-off-by: Keith Lucas <keith.lucas@suse.com>
    Keith Lucas committed Jul 29, 2021
    Copy the full SHA
    92c9644 View commit details
    Browse the repository at this point in the history