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

RHPv4 Client #17

Closed
wants to merge 32 commits into from
Closed

RHPv4 Client #17

wants to merge 32 commits into from

Conversation

ChrisSchinnerl
Copy link
Member

@ChrisSchinnerl ChrisSchinnerl commented Feb 1, 2024

Closes #8

@ChrisSchinnerl ChrisSchinnerl self-assigned this Feb 1, 2024
rhp/v4/client.go Outdated
// dial a stream with a sane deadline
c.mu.Lock()
s := c.mux.DialStream()
c.mu.Unlock()
Copy link
Member

Choose a reason for hiding this comment

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

why lock here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because we swap out the mux sometimes

rhp/v4/client.go Outdated
} else if err := c.resetTransport(ctx); err != nil {
// failed to reset transport
c.mu.Unlock()
return fmt.Errorf("%v: %w", err, errRPC)
Copy link
Member

Choose a reason for hiding this comment

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

I expect the second error is unlikely to be helpful to the caller. I would just return errRPC here

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it's useful to know to determine whether we are not handling resetting the connection correctly or if resetting the connection actually fails. e.g. if the error is "connection refused" we might want to drop the mux completely.

rhp/v4/client.go Outdated Show resolved Hide resolved
rhp/v4/client.go Outdated Show resolved Hide resolved
rhp/v4/client.go Show resolved Hide resolved
rhp/v4/client.go Show resolved Hide resolved
rhp/v4/client.go Outdated Show resolved Hide resolved
rhp/v4/client.go Show resolved Hide resolved
rhp/v4/client.go Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Proposal: Add higher level mux to coreutils
2 participants