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
Use appropriate connector instance based on protocol #263
base: main
Are you sure you want to change the base?
Conversation
Can you fix the test as requested @prakhar10 |
Sorry for the delay, got busy with something else. I'll fix this in a couple of days. |
cfa3cd4
to
32df8a6
Compare
.mapToInt(HttpConnectorFactory::getPort) | ||
.mapToInt(connector -> { | ||
if (connector instanceof HttpsConnectorFactory httpsConnectorFactory) { | ||
return httpsConnectorFactory.getPort(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The implementation of getPort()
method looks same between HttpsConnectorFactory and HttpConnectorFactory. Why do we need to differentiate them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked at porting this to the new class now and also this code. Honestly I share the questions from @ebyhr and I am not sure at all why this change would do anything. I looked the the source of the two factory classes as well and the https one just extends the http one and there is no modification or change or so for the port.
So if this change really resolves the issues.. I dont know why. Thoughts @prakhar10 ?
return httpsConnectorFactory.getPort(); | ||
} | ||
return ((HttpConnectorFactory) connector).getPort(); | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should ensure the retrieved port is unique. The subsequent findFirst()
& orElseThrow()
needs fix.
Should we just use the changes from #294 with the test from this PR and improve in this PR as next step? Could you do that @prakhar10 ? |
Sure @mosabua , but I believe we started off with a similar change and with reviews we've come to this code that I have currently in this PR. But if it helps and if everyone agrees I can bring in the code changes from that PR into this one and we can take it forward. |
Ideally we just address the outstanding comments from @ebyhr ... and ensure the test works as expected. I really think we need to get this merged for the next release. |
By the way, test isn't mandatory in my opinion. This is pretty small change and will be removed when migrating to Airlift. |
Could you rebase on main to resolve conflicts? |
Looks like this file does not exist anymore in the main branch, do we need this PR then @ebyhr ? |
@prakhar10 Please take a look at HaGatewayProviderModule: trino-gateway/gateway-ha/src/main/java/io/trino/gateway/ha/module/HaGatewayProviderModule.java Lines 168 to 183 in 3c20299
|
@prakhar10 are you going to move this change over to the new module? Even potentially without test .. just so we can get this merged and maybe ship as part of the 8 release? |
Hi @prakhar10 , do you need any assistance with this? |
This is to fix #242