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

Let fatal exceptions when getting locked row count bubble up #971

Merged
merged 3 commits into from
Nov 28, 2023

Conversation

Charles-Gagnon
Copy link
Contributor

Was investigating another issue and noticed that we were getting a number of exceptions like this :

Exception executing query. Message=Unable to acquire exclusive lock on _az_func_Trigger. Result = -999 You attempted to acquire a transactional application lock without an active transaction.

When trying to run the "Acquire leases" command. This shouldn't be possible, since I verified that we always open a transaction at the beginning of each loop iteration. But looking into it I realized that this could happen if an exception occurred during the GetLeaseLockedRowCount command. During that we ignore exceptions that occur (since it's just for debuggability) and so if we got in a situation where the exception was fatal it would cause issues like this.

The fix for this was twofold - first was to let the exceptions bubble up. But the current fatal logic wouldn't handle the specific issue I was seeing with the deadlock, since that isn't fatal for the connection (it's still open and usable). What it does do though is end the transaction - which means that all other queries will fail since a transaction is required for the app lock statement.

So I'm fixing it to let the exception bubble up so at least we don't get the noisy extra errors. This doesn't solve the deadlock problem at all - that's the thing I'm still currently investigating.

@Charles-Gagnon Charles-Gagnon merged commit 7a1acfb into main Nov 28, 2023
1 check passed
@Charles-Gagnon Charles-Gagnon deleted the chgagnon/bubbleException branch November 28, 2023 17:47
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.

5 participants