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 leader id initialization #1971

Merged
merged 1 commit into from
Mar 16, 2015
Merged

Fix leader id initialization #1971

merged 1 commit into from
Mar 16, 2015

Conversation

benbjohnson
Copy link
Contributor

Overview

This pull request initializes the in-memory leader ID inside raft. This was accidentally removed during the stateless broker refactor.

@@ -185,8 +185,6 @@ func (h *Handler) servePing(w http.ResponseWriter, r *http.Request) {
log.Printf("unable to write client config: %s", err)
return
}

w.WriteHeader(http.StatusOK)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's going on here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The json.Encoder writes to the ResponseWriter so the header gets flushed. If we call WriteHeader() then we get error messages saying that we're trying to write the header twice.

@otoolep
Copy link
Contributor

otoolep commented Mar 16, 2015

Looks sane.

@toddboom
Copy link
Contributor

👍, merging!

toddboom added a commit that referenced this pull request Mar 16, 2015
@toddboom toddboom merged commit 3bbe35f into master Mar 16, 2015
@toddboom toddboom deleted the fix-leader-init branch March 16, 2015 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants