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

Make Java Client Authentication Asynchronous #19429

Open
1 of 2 tasks
michaeljmarshall opened this issue Feb 5, 2023 · 9 comments
Open
1 of 2 tasks

Make Java Client Authentication Asynchronous #19429

michaeljmarshall opened this issue Feb 5, 2023 · 9 comments
Assignees
Labels
area/client good first issue Good for newcomers help wanted Stale type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages

Comments

@michaeljmarshall
Copy link
Member

Search before asking

  • I searched in the issues and found nothing similar.

Motivation

The OAuth2 client's authenticate call is blocking, which is not great for the client, and is bad for the proxy because the proxy authenticates from a netty event loop.

Solution

In the same way that PIP 97 #12105 make the AuthenticationProvider async, we should update the Authentication interface.

Alternatives

No response

Anything else?

This change will likely require a PIP. I am unable to write such a PIP at this time, so I am creating this issue to keep track of this missing feature.

Are you willing to submit a PR?

  • I'm willing to submit a PR!
@michaeljmarshall michaeljmarshall added type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages component/client-java labels Feb 5, 2023
@github-actions
Copy link

The issue had no activity for 30 days, mark with Stale label.

@github-actions github-actions bot added the Stale label Mar 16, 2023
@tisonkun tisonkun added help wanted good first issue Good for newcomers and removed Stale labels Mar 21, 2023
@tisonkun
Copy link
Member

@michaeljmarshall shall we make a PIP for this enhancement?

@michaeljmarshall
Copy link
Member Author

We could make a PIP, though I don't have time to work on it right now.

@Abhijeetmishr
Copy link

@michaeljmarshall @tisonkun can I pick this up ?

@tisonkun
Copy link
Member

@Abhijeetmishr assigned. Go ahead!

May I ask what's your plan to handle this issue?

@Abhijeetmishr
Copy link

@Abhijeetmishr assigned. Go ahead!

May I ask what's your plan to handle this issue?

Hey @tisonkun Thank you for assigning.
I think this will be achieved using Java Completetable future.
we have to update the interfaces such as AuthenticationProvider, AuthenticationState, and AuthenticationDataSource.
I am not sure about the module. I need little clarification to get started asap.

Regards,
Abhijeet

@github-actions
Copy link

The issue had no activity for 30 days, mark with Stale label.

@arsenalzp
Copy link

Any progress with this issue?

@AbhinavAtul
Copy link

Hi, when trying async lastDisconnectedTimestamp is no longer zero. As a result, ProxyRefreshAuthTest fails (expects lastDisconnectedTimestamp to be zero). If any, what would be an acceptable max disconnect-reconnect interval that could be used as litmus for the test? Disconnect-reconnect log inline

2023-12-06T06:42:04,556 - INFO  - [pulsar-client-io-44-3:ConnectionPool@270] - [[id: 0x27a867ef, L:/127.0.0.1:45060 - R:************/127.0.1.1:39725]] Connected to server
2023-12-06T06:42:04,647 - INFO  - [pulsar-proxy-io-42-5:ConnectionPool@270] - [[id: 0x30bb7cae, L:/127.0.0.1:57236 - R:************/127.0.1.1:34547]] Connected to server
2023-12-06T06:42:04,700 - INFO  - [pulsar-io-8-1:ServerCnx@731] - [/127.0.0.1:57236] connected role=Proxy and originalAuthRole=client using authMethod=token, clientVersion=Pulsar-Java-v3.2.0-SNAPSHOT, clientProtocolVersion=21, proxyVersion=3.2.0-SNAPSHOT
2023-12-06T06:42:06,690 - INFO  - [pulsar-proxy-io-42-5:ClientCnx@347] - [id: 0x30bb7cae, L:/127.0.0.1:57236 ! R:************/127.0.1.1:34547] Disconnected
2023-12-06T06:42:06,746 - INFO  - [pulsar-proxy-io-42-7:ConnectionPool@270] - [[id: 0x0acdfa58, L:/127.0.0.1:57238 - R:************/127.0.1.1:34547]] Connected to server
2023-12-06T06:42:06,753 - INFO  - [pulsar-io-8-2:ServerCnx@731] - [/127.0.0.1:57238] connected role=Proxy and originalAuthRole=client using authMethod=token, clientVersion=Pulsar-Java-v3.2.0-SNAPSHOT, clientProtocolVersion=21, proxyVersion=3.2.0-SNAPSHOT
2023-12-06T06:42:07,641 - INFO  - [pulsar-client-io-44-3:ClientCnx@347] - [id: 0x27a867ef, L:/127.0.0.1:45060 ! R:************/127.0.1.1:39725] Disconnected
2023-12-06T06:42:07,653 - INFO  - [pulsar-proxy-io-42-7:ClientCnx@347] - [id: 0x0acdfa58, L:/127.0.0.1:57238 ! R:************/127.0.1.1:34547] Disconnected
2023-12-06T06:42:07,738 - INFO  - [pulsar-client-io-44-5:ConnectionPool@270] - [[id: 0x812e0999, L:/127.0.0.1:45062 - R:************/127.0.1.1:39725]] Connected to server
2023-12-06T06:42:07,758 - INFO  - [pulsar-proxy-io-42-12:ConnectionPool@270] - [[id: 0x5b59280a, L:/127.0.0.1:57240 - R:************/127.0.1.1:34547]] Connected to server
2023-12-06T06:42:07,765 - INFO  - [pulsar-io-8-3:ServerCnx@731] - [/127.0.0.1:57240] connected role=Proxy and originalAuthRole=client using authMethod=token, clientVersion=Pulsar-Java-v3.2.0-SNAPSHOT, clientProtocolVersion=21, proxyVersion=3.2.0-SNAPSHOT
2023-12-06T06:42:09,767 - INFO  - [pulsar-proxy-io-42-12:ClientCnx@347] - [id: 0x5b59280a, L:/127.0.0.1:57240 ! R:************/127.0.1.1:34547] Disconnected
2023-12-06T06:42:09,863 - INFO  - [pulsar-proxy-io-42-14:ConnectionPool@270] - [[id: 0x385fd2e9, L:/127.0.0.1:57254 - R:************/127.0.1.1:34547]] Connected to server
2023-12-06T06:42:09,871 - INFO  - [pulsar-io-8-4:ServerCnx@731] - [/127.0.0.1:57254] connected role=Proxy and originalAuthRole=client using authMethod=token, clientVersion=Pulsar-Java-v3.2.0-SNAPSHOT, clientProtocolVersion=21, proxyVersion=3.2.0-SNAPSHOT
2023-12-06T06:42:10,753 - INFO  - [pulsar-client-io-44-5:ClientCnx@347] - [id: 0x812e0999, L:/127.0.0.1:45062 ! R:************/127.0.1.1:39725] Disconnected
2023-12-06T06:42:10,755 - INFO  - [pulsar-proxy-io-42-14:ClientCnx@347] - [id: 0x385fd2e9, L:/127.0.0.1:57254 ! R:************/127.0.1.1:34547] Disconnected
2023-12-06T06:42:10,855 - INFO  - [pulsar-client-io-44-7:ConnectionPool@270] - [[id: 0x330b9cb9, L:/127.0.0.1:45072 - R:************/127.0.1.1:39725]] Connected to server
2023-12-06T06:42:10,875 - INFO  - [pulsar-proxy-io-42-19:ConnectionPool@270] - [[id: 0xcfedf2eb, L:/127.0.0.1:57266 - R:************/127.0.1.1:34547]] Connected to server
2023-12-06T06:42:10,878 - INFO  - [pulsar-io-8-1:ServerCnx@731] - [/127.0.0.1:57266] connected role=Proxy and originalAuthRole=client using authMethod=token, clientVersion=Pulsar-Java-v3.2.0-SNAPSHOT, clientProtocolVersion=21, proxyVersion=3.2.0-SNAPSHOT
2023-12-06T06:42:12,882 - INFO  - [pulsar-proxy-io-42-19:ClientCnx@347] - [id: 0xcfedf2eb, L:/127.0.0.1:57266 ! R:************/127.0.1.1:34547] Disconnected
2023-12-06T06:42:12,941 - INFO  - [pulsar-proxy-io-42-21:ConnectionPool@270] - [[id: 0x026b593c, L:/127.0.0.1:44420 - R:************/127.0.1.1:34547]] Connected to server
2023-12-06T06:42:12,945 - INFO  - [pulsar-io-8-2:ServerCnx@731] - [/127.0.0.1:44420] connected role=Proxy and originalAuthRole=client using authMethod=token, clientVersion=Pulsar-Java-v3.2.0-SNAPSHOT, clientProtocolVersion=21, proxyVersion=3.2.0-SNAPSHOT
2023-12-06T06:42:13,873 - INFO  - [pulsar-client-io-44-7:ClientCnx@347] - [id: 0x330b9cb9, L:/127.0.0.1:45072 ! R:************/127.0.1.1:39725] Disconnected
2023-12-06T06:42:13,875 - INFO  - [pulsar-proxy-io-42-21:ClientCnx@347] - [id: 0x026b593c, L:/127.0.0.1:44420 ! R:************/127.0.1.1:34547] Disconnected
2023-12-06T06:42:13,917 - INFO  - [pulsar-client-io-44-9:ConnectionPool@270] - [[id: 0xadfa256c, L:/127.0.0.1:48706 - R:************/127.0.1.1:39725]] Connected to server
2023-12-06T06:42:13,936 - INFO  - [pulsar-proxy-io-42-26:ConnectionPool@270] - [[id: 0x14c0d475, L:/127.0.0.1:44430 - R:************/127.0.1.1:34547]] Connected to server
2023-12-06T06:42:13,939 - INFO  - [pulsar-io-8-3:ServerCnx@731] - [/127.0.0.1:44430] connected role=Proxy and originalAuthRole=client using authMethod=token, clientVersion=Pulsar-Java-v3.2.0-SNAPSHOT, clientProtocolVersion=21, proxyVersion=3.2.0-SNAPSHOT
2023-12-06T06:42:14,852 - INFO  - [pulsar-client-io-44-9:ClientCnx@347] - [id: 0xadfa256c, L:/127.0.0.1:48706 ! R:************/127.0.1.1:39725] Disconnected
2023-12-06T06:42:14,855 - INFO  - [pulsar-proxy-io-42-26:ClientCnx@347] - [id: 0x14c0d475, L:/127.0.0.1:44430 ! R:************/127.0.1.1:34547] Disconnected





2023-12-06T06:42:24,191 - INFO  - [pulsar-client-io-137-3:ConnectionPool@270] - [[id: 0xfd5eede1, L:/127.0.0.1:35268 - R:************/127.0.1.1:33501]] Connected to server
2023-12-06T06:42:24,207 - INFO  - [pulsar-proxy-io-135-5:ConnectionPool@270] - [[id: 0x1c71fa15, L:/127.0.0.1:59474 - R:************/127.0.1.1:36575]] Connected to server
2023-12-06T06:42:24,212 - INFO  - [pulsar-io-102-1:ServerCnx@731] - [/127.0.0.1:59474] connected role=Proxy and originalAuthRole=client using authMethod=token, clientVersion=Pulsar-Java-v3.2.0-SNAPSHOT, clientProtocolVersion=21, proxyVersion=3.2.0-SNAPSHOT
2023-12-06T06:42:26,214 - INFO  - [pulsar-proxy-io-135-5:ClientCnx@347] - [id: 0x1c71fa15, L:/127.0.0.1:59474 ! R:************/127.0.1.1:36575] Disconnected
2023-12-06T06:42:26,253 - INFO  - [pulsar-proxy-io-135-7:ConnectionPool@270] - [[id: 0x2117711d, L:/127.0.0.1:59482 - R:************/127.0.1.1:36575]] Connected to server
2023-12-06T06:42:26,258 - INFO  - [pulsar-io-102-2:ServerCnx@731] - [/127.0.0.1:59482] connected role=Proxy and originalAuthRole=client using authMethod=token, clientVersion=Pulsar-Java-v3.2.0-SNAPSHOT, clientProtocolVersion=21, proxyVersion=3.2.0-SNAPSHOT
2023-12-06T06:42:27,205 - INFO  - [pulsar-client-io-137-3:ClientCnx@347] - [id: 0xfd5eede1, L:/127.0.0.1:35268 ! R:************/127.0.1.1:33501] Disconnected
2023-12-06T06:42:27,206 - INFO  - [pulsar-proxy-io-135-7:ClientCnx@347] - [id: 0x2117711d, L:/127.0.0.1:59482 ! R:************/127.0.1.1:36575] Disconnected
2023-12-06T06:42:27,217 - INFO  - [pulsar-client-io-137-5:ConnectionPool@270] - [[id: 0xa5e87959, L:/127.0.0.1:35272 - R:************/127.0.1.1:33501]] Connected to server
2023-12-06T06:42:27,228 - INFO  - [pulsar-proxy-io-135-12:ConnectionPool@270] - [[id: 0xa887c0a9, L:/127.0.0.1:59488 - R:************/127.0.1.1:36575]] Connected to server
2023-12-06T06:42:27,232 - INFO  - [pulsar-io-102-3:ServerCnx@731] - [/127.0.0.1:59488] connected role=Proxy and originalAuthRole=client using authMethod=token, clientVersion=Pulsar-Java-v3.2.0-SNAPSHOT, clientProtocolVersion=21, proxyVersion=3.2.0-SNAPSHOT
2023-12-06T06:42:29,235 - INFO  - [pulsar-proxy-io-135-12:ClientCnx@347] - [id: 0xa887c0a9, L:/127.0.0.1:59488 ! R:************/127.0.1.1:36575] Disconnected
2023-12-06T06:42:29,264 - INFO  - [pulsar-proxy-io-135-14:ConnectionPool@270] - [[id: 0x9fe34a7a, L:/127.0.0.1:59502 - R:************/127.0.1.1:36575]] Connected to server
2023-12-06T06:42:29,268 - INFO  - [pulsar-io-102-4:ServerCnx@731] - [/127.0.0.1:59502] connected role=Proxy and originalAuthRole=client using authMethod=token, clientVersion=Pulsar-Java-v3.2.0-SNAPSHOT, clientProtocolVersion=21, proxyVersion=3.2.0-SNAPSHOT
2023-12-06T06:42:30,231 - INFO  - [pulsar-proxy-io-135-14:ClientCnx@347] - [id: 0x9fe34a7a, L:/127.0.0.1:59502 ! R:************/127.0.1.1:36575] Disconnected
2023-12-06T06:42:30,234 - INFO  - [pulsar-client-io-137-5:ClientCnx@347] - [id: 0xa5e87959, L:/127.0.0.1:35272 ! R:************/127.0.1.1:33501] Disconnected
2023-12-06T06:42:30,337 - INFO  - [pulsar-client-io-137-7:ConnectionPool@270] - [[id: 0xb189711c, L:/127.0.0.1:35280 - R:************/127.0.1.1:33501]] Connected to server
2023-12-06T06:42:30,348 - INFO  - [pulsar-proxy-io-135-19:ConnectionPool@270] - [[id: 0xb850dc3e, L:/127.0.0.1:59506 - R:************/127.0.1.1:36575]] Connected to server
2023-12-06T06:42:30,351 - INFO  - [pulsar-io-102-1:ServerCnx@731] - [/127.0.0.1:59506] connected role=Proxy and originalAuthRole=client using authMethod=token, clientVersion=Pulsar-Java-v3.2.0-SNAPSHOT, clientProtocolVersion=21, proxyVersion=3.2.0-SNAPSHOT
2023-12-06T06:42:32,353 - INFO  - [pulsar-proxy-io-135-19:ClientCnx@347] - [id: 0xb850dc3e, L:/127.0.0.1:59506 ! R:************/127.0.1.1:36575] Disconnected
2023-12-06T06:42:32,387 - INFO  - [pulsar-proxy-io-135-21:ConnectionPool@270] - [[id: 0x896a6dfb, L:/127.0.0.1:57736 - R:************/127.0.1.1:36575]] Connected to server
2023-12-06T06:42:32,391 - INFO  - [pulsar-io-102-2:ServerCnx@731] - [/127.0.0.1:57736] connected role=Proxy and originalAuthRole=client using authMethod=token, clientVersion=Pulsar-Java-v3.2.0-SNAPSHOT, clientProtocolVersion=21, proxyVersion=3.2.0-SNAPSHOT
2023-12-06T06:42:33,348 - INFO  - [pulsar-client-io-137-7:ClientCnx@347] - [id: 0xb189711c, L:/127.0.0.1:35280 ! R:************/127.0.1.1:33501] Disconnected
2023-12-06T06:42:33,350 - INFO  - [pulsar-proxy-io-135-21:ClientCnx@347] - [id: 0x896a6dfb, L:/127.0.0.1:57736 ! R:************/127.0.1.1:36575] Disconnected
2023-12-06T06:42:33,353 - INFO  - [pulsar-client-io-137-9:ConnectionPool@270] - [[id: 0x8ba37811, L:/127.0.0.1:47940 - R:************/127.0.1.1:33501]] Connected to server
2023-12-06T06:42:33,369 - INFO  - [pulsar-proxy-io-135-26:ConnectionPool@270] - [[id: 0x4a8abb46, L:/127.0.0.1:57740 - R:************/127.0.1.1:36575]] Connected to server
2023-12-06T06:42:33,373 - INFO  - [pulsar-io-102-3:ServerCnx@731] - [/127.0.0.1:57740] connected role=Proxy and originalAuthRole=client using authMethod=token, clientVersion=Pulsar-Java-v3.2.0-SNAPSHOT, clientProtocolVersion=21, proxyVersion=3.2.0-SNAPSHOT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/client good first issue Good for newcomers help wanted Stale type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages
Projects
None yet
Development

No branches or pull requests

6 participants