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

=remote Make ues of Netty's default resolver. #651

Merged
merged 1 commit into from
Sep 18, 2023

Conversation

He-Pin
Copy link
Member

@He-Pin He-Pin commented Sep 15, 2023

Motivation:
In Netty 4 , which ships with default resolver, so I think the blocking code can be removed.

refs: akka/akka#12960

Netty's Default resolver is the InetSocketResolver too.

@He-Pin He-Pin force-pushed the AddressResolver branch 3 times, most recently from c380a4e to 6652cc3 Compare September 16, 2023 05:42
@He-Pin He-Pin force-pushed the AddressResolver branch 2 times, most recently from ebf6cc5 to 51361bc Compare September 16, 2023 07:40
@He-Pin He-Pin mentioned this pull request Sep 16, 2023
@He-Pin He-Pin force-pushed the AddressResolver branch 2 times, most recently from 35acaa8 to 5524b4b Compare September 18, 2023 13:12
@He-Pin
Copy link
Member Author

He-Pin commented Sep 18, 2023

@pjfanning @mdedetrich This is ready

Copy link
Contributor

@pjfanning pjfanning left a comment

Choose a reason for hiding this comment

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

not sure about removing public methods

override def associate(remoteAddress: Address): Future[AssociationHandle] = {
if (!serverChannel.isActive) Future.failed(new NettyTransportException("Transport is not bound"))
else {
val bootstrap: ClientBootstrap = outboundBootstrap(remoteAddress)

(for {
socketAddress <- addressToSocketAddress(remoteAddress)
readyChannel <- NettyFutureBridge(bootstrap.connect(socketAddress)).map { channel =>
(host, port) <- Future.fromTry(Try(extractHostAndPort(remoteAddress)))
Copy link
Contributor

Choose a reason for hiding this comment

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

this seems bad to wrap the extractHostAndPort in a Try and a Future. Why do this call before the for comprehension so you won't need to wrap the result.

Copy link
Member Author

@He-Pin He-Pin Sep 18, 2023

Choose a reason for hiding this comment

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

Because it throws, the current style will keep the exception been handled by the recover block.

Copy link
Contributor

@pjfanning pjfanning left a comment

Choose a reason for hiding this comment

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

lgtm

@He-Pin He-Pin merged commit 62bf7cb into apache:main Sep 18, 2023
16 of 17 checks passed
@He-Pin He-Pin deleted the AddressResolver branch September 18, 2023 15:08
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.

4 participants