Skip to content

Ignore error if can't write back multistream protocol id#89

Merged
MarcoPolo merged 2 commits intomasterfrom
marco/fix-write-and-close-2
Jun 27, 2022
Merged

Ignore error if can't write back multistream protocol id#89
MarcoPolo merged 2 commits intomasterfrom
marco/fix-write-and-close-2

Conversation

@MarcoPolo
Copy link
Contributor

A continuation of #87. It's the same thing, but we didn't account for the case the the stream is closed so early we don't get a chance to write our multistream select protocol id.

Worth noting that the old NegotiateLazy also ignored this error, so it should be a safe change (since this is the same as the old behavior).

@MarcoPolo MarcoPolo requested a review from marten-seemann June 24, 2022 23:04
}

func TestNegotiateFail(t *testing.T) {
func TestNegotiatThenWriteFail(t *testing.T) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@marten-seemann highlighting this change. I'm changing this test so that it passes with the current behavior (negotiate works even if you can't write to it).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This change goes makes this behavor more like negotiatelazy (wrt write errors). See the previous change here: https://github.com/multiformats/go-multistream/pull/85/files#diff-e59d8a202c91e1303878fa9a18fea9f6a2e3258b609bf4cc1874a17314cb26f8L679

@MarcoPolo MarcoPolo merged commit 7d0eb23 into master Jun 27, 2022
@MarcoPolo MarcoPolo deleted the marco/fix-write-and-close-2 branch June 27, 2022 15:09
@MarcoPolo MarcoPolo mentioned this pull request Jun 27, 2022
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.

2 participants