-
Notifications
You must be signed in to change notification settings - Fork 323
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
Do not report exceptions on long running Excel reads #11916
Do not report exceptions on long running Excel reads #11916
Conversation
This change introduces two modifications: - `ClosedByInterruptException` is wrapped in `InterruptedException` instead of `RuntimeException` - when instrumentation encounters `InterruptedException` it bails early Having `ClosedByInterruptException` wrapped in `RuntimeException` meant that it is being reported as a regular `HostException` in the engine and to the user. Instead it should be treated specially since we know that it is caused by cancelling a long-running job. Since it is a statically checked exception it has to be declared and the information has to be propagated through various lambda constructs (thanks Java!). The above change alone meant that an error is not reported for `Data.read` nodes but any values dependent on it would still report `No_Such_Method` error when the exception is reported as a value. Hence the early bail out mechanism.
5c8e588
to
d8736a1
Compare
The information could be used in GUI to indicate pending execution that will take tad longer.
Pending some tests but otherwise good to review. |
...language-server/src/main/scala/org/enso/languageserver/runtime/ContextRegistryProtocol.scala
Outdated
Show resolved
Hide resolved
Reduce `PendingInterrupted` to a flag in `Pending`
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.
I'm wondering if creating some new unchecked variant of InterruptedException
wouldn't make things easier?
On the other hand it feels nice that we have a clear indication which methods are more prone to interrupts (although it feels like any method can be interrupted anyway, no?).
Anyway, looks OK.
It's actually fairly mechanical with a decent IDE. And having checked exceptions is actually pretty beneficial in finding bugs. |
* @param <E> the type of the checked exception | ||
*/ | ||
@FunctionalInterface | ||
public interface FunctionWithException<T, R, E extends Throwable> { |
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.
We are one step away from inventing monads
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.
😆
Pull Request Description
This change introduces two modifications:
ClosedByInterruptException
is wrapped inInterruptedException
instead ofRuntimeException
InterruptedException
it bails earlyHaving
ClosedByInterruptException
wrapped inRuntimeException
meant that it is being reported as a regularHostException
in the engine and to the user. Instead it should be treated specially since we know that it is caused by cancelling a long-running job. Since it is a statically checked exception it has to be declared and the information has to be propagated through various lambda constructs (thanks Java!).The above change alone meant that an error is not reported for
Data.read
nodes but any values dependent on it would still reportNo_Such_Method
error when the exception is reported as a value. Hence the early bail out mechanism.Additional bonus: LS will send
PendingInterrupted
to GUI that indicates a slightly longer computation that has been interrupted and will be retried.Closes #11896
Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
TypeScript,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.
or the Snowflake database integration, a run of the Extra Tests has been scheduled.