alexguo-db opened a new pull request, #3188:
URL: https://github.com/apache/arrow-adbc/pull/3188
## Proposed Changes
- Currently, before we send an HttpRequest, we await RenewTokenIfNeededAsync
which blocks the HttpRequest on the token refresh
- Make this run in a non-blocking background task, so that a token refresh
is triggered but the request will continue using the existing token
- When the background task completes, use the new token refresh
- This is to improve latency since requests don't wait on the token refresh
- The risk is that there is a potential to use expired tokens if the
background task doesn't complete in time, however this can be mitigated by
setting TokenRenewLimit property to refresh X minutes before the token expires
## Testing
`dotnet test --filter "FullyQualifiedName~TokenExchangeTests"`
```
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v3.1.1+bf6400fd51 (64-bit
.NET 8.0.7)
[xUnit.net 00:00:00.04] Discovering:
Apache.Arrow.Adbc.Tests.Drivers.Databricks
[xUnit.net 00:00:00.12] Discovered:
Apache.Arrow.Adbc.Tests.Drivers.Databricks
[xUnit.net 00:00:00.13] Starting:
Apache.Arrow.Adbc.Tests.Drivers.Databricks
[xUnit.net 00:00:11.02]
Apache.Arrow.Adbc.Tests.Drivers.Databricks.Auth.TokenExchangeTests.TokenExchangeHandler_WithValidTokenNotNearExpiry_UsesOriginalToken
[SKIP]
[xUnit.net 00:00:11.02] Access token is too close to expiration for
this test
[xUnit.net 00:00:11.34] Finished:
Apache.Arrow.Adbc.Tests.Drivers.Databricks
Apache.Arrow.Adbc.Tests.Drivers.Databricks test net8.0 succeeded (11.8s)
Test summary: total: 3, failed: 0, succeeded: 2, skipped: 1, duration: 11.7s
Build succeeded in 13.6s
```
`dotnet test --filter
"FullyQualifiedName~TokenExchangeDelegatingHandlerTests"`
```
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v3.1.1+bf6400fd51 (64-bit
.NET 8.0.7)
[xUnit.net 00:00:00.06] Discovering:
Apache.Arrow.Adbc.Tests.Drivers.Databricks
[xUnit.net 00:00:00.14] Discovered:
Apache.Arrow.Adbc.Tests.Drivers.Databricks
[xUnit.net 00:00:00.16] Starting:
Apache.Arrow.Adbc.Tests.Drivers.Databricks
[xUnit.net 00:00:01.76] Finished:
Apache.Arrow.Adbc.Tests.Drivers.Databricks
Apache.Arrow.Adbc.Tests.Drivers.Databricks test net8.0 succeeded (2.4s)
Test summary: total: 14, failed: 0, succeeded: 14, skipped: 0, duration: 2.4s
Build succeeded in 3.8s
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]