Skip to content

Push to the notify channel and shutdown sign arriving,it is pick one of two but actually nobody know which one #566

@SchopenhauerZhang

Description

@SchopenhauerZhang

i test code found it, i am not sure it is a bug or it is designned; but it is weird;

When Push to the notify channel ,received shutdown sign.we know it is pick one of two,but actually run which one,God knows.

follow the code ,https://github.com/hashicorp/raft/blob/main/raft.go#L434

notify := r.config().NotifyCh

	// Push to the notify channel if given
	if notify != nil {
		select {
		case notify <- true:
		case <-r.shutdownCh:
		}
	}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions