-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[feat][proxy] PIP 97: Implement for ProxyConnection #19292
[feat][proxy] PIP 97: Implement for ProxyConnection #19292
Conversation
ac3d94d
to
6db2232
Compare
pulsar-proxy/src/main/java/org/apache/pulsar/proxy/server/ProxyConnection.java
Outdated
Show resolved
Hide resolved
remoteAddress, authMethod); | ||
} | ||
state = State.Connecting; | ||
} catch (Exception e) { |
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.
why do we catch blindly "Exception" here ?
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 wrote it this way because we are in a callback and if we miss the exception, we will leak the connection forever. If we think we should only catch more specific exceptions, I can update it to catch AuthenticationExcpetion
and RuntimeException
.
pulsar-proxy/src/test/java/org/apache/pulsar/proxy/server/ProxyAuthenticationTest.java
Show resolved
Hide resolved
The last commit is effectively present in this PR: #19331. I wanted that one to get it's own review since it complicates this PR. Once that is merged, it'll be out of the diff in this PR. |
PIP: apache#12105 Implement asynchronous auth for the proxy connection. This is one of the core PRs for implementing apache#12105. * Update `ProxyConnection` class to asynchronously handle the authentication result. The result is handled on the handler's event loop to ensure correctness. * Update `ProxyAuthenticationTest` class to implement async auth methods and to make authentication asynchronous to test that code path. There is an updated test, but it doesn't cover all code paths in this PR. - [x] `doc-not-needed` We do not need to document this portion of PIP 97. PR in forked repository: #16 (cherry picked from commit fa6af43)
PIP: #12105
Motivation
Implement asynchronous auth for the proxy connection. This is one of the core PRs for implementing #12105.
Modifications
ProxyConnection
class to asynchronously handle the authentication result. The result is handled on the handler's event loop to ensure correctness.ProxyAuthenticationTest
class to implement async auth methods and to make authentication asynchronous to test that code path.Verifying this change
There is an updated test, but it doesn't cover all code paths in this PR.
Documentation
doc-not-needed
We do not need to document this portion of PIP 97.
Matching PR in forked repository
PR in forked repository: michaeljmarshall#16