-
Notifications
You must be signed in to change notification settings - Fork 4
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
DM-45340: Improve exception handling in quantum executors #297
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #297 +/- ##
==========================================
+ Coverage 87.25% 87.28% +0.03%
==========================================
Files 50 50
Lines 4581 4585 +4
Branches 788 788
==========================================
+ Hits 3997 4002 +5
Misses 422 422
+ Partials 162 161 -1 ☔ View full report in Codecov by Sentry. |
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.
This PR doesn't actually fix the problem -- the new code in MpGraphExecutor
is exactly as vulnerable to interrupts as the old code in SingleQuantumExecutor
was (raising in the first task instead of a later one was a red herring). Having now seen the code for myself, I suspect catching the exception from getReport
is the best solution.
I also recommend doing updates, code style, and maintenance on separate commits from the main work; it usually makes sense to do them first.
@kfindeisen, I am certain that this indeed fixes the problem. Can you reproduce the crash that you saw before? |
This should solve an issue with exceptions happening at unpredictable locations in a SingleQuantumExecutor class. MPGraphExecutor in a single-process mode should also behave reasonably for random exceptions. Multi-process mode has more complex internal state. If a client of the code catches an exception and tries to reuse the executor, the state may be inconsistent, depending on where the exception happens.
b0c05c4
to
cb84fe4
Compare
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.
Looks much better, thanks.
This should solve an issue with exceptions happening at unpredictable locations in a SingleQuantumExecutor class. MPGraphExecutor in a single-process mode should also behave reasonably for random exceptions. Multi-process mode has more complex internal state. If a client of the code catches an exception and tries to reuse the executor, the state may be inconsistent, depending on where the exception happens.
Checklist
doc/changes