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

Update Workflow Type #15953

Merged
merged 5 commits into from
May 3, 2024
Merged

Update Workflow Type #15953

merged 5 commits into from
May 3, 2024

Conversation

MikeAlhayek
Copy link
Member

@MikeAlhayek MikeAlhayek commented May 2, 2024

@Piedone I am not sure if this is going to fix the issue we are seeing. But I think we should pass the current transaction to that query because the Query may flush any data associated with that transaction.

Unless you see an issue here, I would like to take this change and test it out. It's not easy to detect the problem since it's not consistent.

@MikeAlhayek MikeAlhayek requested a review from Piedone May 2, 2024 19:14
Comment on lines +128 to +130
// Use existing session connection. Do not use 'using' or dispose the connection.
var connection = await _session.CreateConnectionAsync();
var workflowTypeIdsWithInstances = (await connection.QueryAsync<string>(sqlBuilder.ToSqlString(), param: null, _session.CurrentTransaction)).ToList();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes look OK but how do they fix the issue?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if it did or not. The issue in production happens randomly which is really hard to reproduce. But this is the only suspicious code since it's the only place to try to reuse the current connection. In production, the issue seems to happen when we list the workflow types. I think the fact we could be writing data to the current transaction and then read on the same connection seems that we should be passing the transaction.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, OK, this won't hurt, but I really don't see what here would fix the exception. BTW this might be related: #15290.

@MikeAlhayek MikeAlhayek requested a review from Piedone May 3, 2024 00:57
@MikeAlhayek MikeAlhayek merged commit dc70203 into main May 3, 2024
26 checks passed
@MikeAlhayek MikeAlhayek deleted the ma/wfquery branch May 3, 2024 01:25
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.

3 participants