Conversation
When a custom TraceRay filter / EnumerateEntities enumerator callback throws an exception we currently continue execution and then return execution to the calling code as if there were no problems. This currently causes a heap tracking issue in SourcePawn, but even ignoring that it is likely the wrong behaviour and differs from our other synchronous callbacks. This change causes the exception to be caught, immediately terminates the trace / enumeration, and propagates the exception state back to the calling plugin correctly. The implementation here is based on how SortCustom1D handles exceptions.
Member
|
I'm not sure we want this. Each plugin callback is fired individually, so it enters the function, has an error, it should continue firing until done, no? I could go either way, though. |
Member
Author
|
Unfortunately in both cases if the callback has errored at all the trace/enumeration probably hasn't done what was intended - a big part of the change here is that now the error propagates back up so that execution doesn't continue as the state is bad, so it doesn't make sense to keep calling the callback. |
KyleSanderson
approved these changes
Aug 1, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a custom TraceRay filter / EnumerateEntities enumerator callback
throws an exception we currently continue execution and then return
execution to the calling code as if there were no problems. This
currently causes a heap tracking issue in SourcePawn, but even ignoring
that it is likely the wrong behaviour and differs from our other
synchronous callbacks.
This change causes the exception to be caught, immediately terminates
the trace / enumeration, and propagates the exception state back to the
calling plugin correctly. The implementation here is based on how
SortCustom1D handles exceptions.
See also alliedmodders/sourcepawn#607. Thanks again to @dysphie for the report.