Skip to content

Conversation

crepererum
Copy link
Collaborator

This avoids that we write partial messages to the underlying TCP/TLS
connection and mess up message framing. This will nearly always lead to
broker-side errors and the broker closes the connection.

Fixes #103.

This avoids that we write partial messages to the underlying TCP/TLS
connection and mess up message framing. This will nearly always lead to
broker-side errors and the broker closes the connection.

Fixes #103.
@crepererum crepererum requested a review from tustvold March 7, 2022 15:59
Copy link
Contributor

@tustvold tustvold left a comment

Choose a reason for hiding this comment

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

Looks good to me, I think the test has a race, but otherwise 💪

}

#[tokio::test]
async fn test_cancel_request() {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this test would be easier to follow if the loops were broken up into separate functions, but it's fine as is also

src/messenger.rs Outdated
// simulated broker, just reads messages and answers w/ "api versions" responses
let handle_broker = tokio::spawn(async move {
for correlation_id in 0.. {
rx_back.read_message(1_000).await.unwrap();
Copy link
Contributor

Choose a reason for hiding this comment

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

Could possibly check that the message is an ApiVersions request

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

@crepererum crepererum force-pushed the crepererum/issue103 branch from 2fdfca0 to db79dba Compare March 7, 2022 17:17
@crepererum crepererum added the automerge Instruct kodiak to merge the PR label Mar 7, 2022
@kodiakhq kodiakhq bot merged commit b5d8607 into main Mar 7, 2022
@kodiakhq kodiakhq bot deleted the crepererum/issue103 branch March 7, 2022 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Instruct kodiak to merge the PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Frequent connection losses
2 participants