Skip to content

Conversation

@dgiagio
Copy link

@dgiagio dgiagio commented Nov 4, 2025

This PR fixes an issue where the driver discards the context.Context during polling, making it impossible to use authentication mechanisms (like Azure OBO) that rely on passing credentials via the context.

Reference:

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)
Copy link
Collaborator

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)
Copy link
Collaborator

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) {

Copy link
Collaborator

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants