Skip to content

Conversation

@t089
Copy link
Contributor

@t089t089 commented Jun 27, 2019

As discussed in #54, currently if using a shared event loop group object to create a HTTPClient, the eventLoop property of the Channel will most likely not be the same as the eventLoop property of the Task. This can lead to a precondition failure, when the task delegate hops to the the task`s event loop.

This patch makes sure that both the task and the connection (channel) share the same event loop instance.

It also add a precondition on Task.setChannel(_:) to verify that the channel uses the same event loop as the task.

The provided test would trigger the precondition failure if the event loops would not match.

@swift-server-bot
Copy link

Can one of the admins verify this patch?

@weissiweissi requested review from Lukasa and artemredkinJune 27, 2019 10:56
@artemredkin
Copy link
Collaborator

@swift-server-bot test this please

@artemredkin
Copy link
Collaborator

@t089 thanks for the patch! could you update HTTPClientTests+XCTest.swift for linux tests?

@t089
Copy link
ContributorAuthor

t089 commented Jul 1, 2019

@artemredkin I ran ./scripts/generate_linux_tests.rb

@artemredkin
Copy link
Collaborator

@swift-server-bot test this please

@artemredkinartemredkin requested a review from weissiJuly 1, 2019 10:05
@weissi
Copy link
Contributor

@t089 sorry, there are conflicts now. We can merge this when they're fixed.

Copy link
Contributor

@weissiweissi 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, thank you!

@t089
Copy link
ContributorAuthor

t089 commented Jul 3, 2019

Thanks. Rebased on master.

@weissi
Copy link
Contributor

wow that was quick, thanks so much @t089

@weissiweissi merged commit daf66bd into swift-server:masterJul 3, 2019
Sign up for freeto 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.

4 participants

@t089@swift-server-bot@artemredkin@weissi