-
Notifications
You must be signed in to change notification settings - Fork 53
Fix context loss in polling and connection close operations #295
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Diego Giagio <[email protected]>
| var statusResp *cli_service.TGetOperationStatusResp | ||
| ctx = driverctx.NewContextWithConnId(ctx, c.id) | ||
| newCtx := driverctx.NewContextWithCorrelationId(driverctx.NewContextWithConnId(context.Background(), c.id), corrId) | ||
| newCtx := context.WithoutCancel(ctx) |
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.
if context is cancelled, polling will not have cancellation information. Won't this affect cancellation of long running queries?
| var statusResp *cli_service.TGetOperationStatusResp | ||
| ctx = driverctx.NewContextWithConnId(ctx, c.id) | ||
| newCtx := driverctx.NewContextWithCorrelationId(driverctx.NewContextWithConnId(context.Background(), c.id), corrId) | ||
| newCtx := context.WithoutCancel(ctx) |
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 see that context.WithoutCancel was added in Go 1.21, but go.mod pins to v1.20. This will fail.
Do we need a version change in go.mod as well?
| config *config.Config, | ||
| directResults *cli_service.TSparkDirectResults, | ||
| ) (driver.Rows, dbsqlerr.DBError) { | ||
|
|
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.
do we need a check for context being nil?
This PR fixes an issue where the driver discards the
context.Contextduring polling, making it impossible to use authentication mechanisms (like Azure OBO) that rely on passing credentials via the context.Reference: