-
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
DataflowError.withoutTrace shall not store a trace #8608
Conversation
As mentioned (pt. 2) full stack traces of dataflow errors are really quite invaluable for debugging. Can we at least add some option (e.g. environment variable, engine runner option?) that re-enables the full traces at the cost of performance? Something like a 'debug' mode? |
While I hear you I don't think there is a way to have exactly correct stacktraces and excellent performance for deep_arr n =
err = Error.throw (Illegal_Argument.Error "Problem"+n.to_text)
if n <= 0 then [err] else deep_arr n-1 + [err] and such a
Knowing (at
In any case tracking exact stacktraces cannot be default & automatic, if the performance shall be on par with |
Right now there are:
|
I understand. That's why I suggested relying on an environment variable or runner option allowing us to 'enable detailed dataflow stack traces'. This can be a compile-time constant, that can be checked at |
What about enabling deep stack traces when JVM assertions ( |
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.
Consider enabling full stack traces when assertions enabled (#8608 (comment)). But that might be too complicated to implement. At least in this PR. Looks fine otherwise. Also, don't forget to report the performance changes pls.
...me/src/main/java/org/enso/interpreter/node/expression/builtin/runtime/GetStackTraceNode.java
Show resolved
Hide resolved
engine/runtime/src/main/java/org/enso/interpreter/runtime/error/DataflowError.java
Outdated
Show resolved
Hide resolved
I don't think we can merge a PR that disables stack traces and does not give us a way to enable them in debug mode. That would hinder developer UX horribly. I would very much appreciate being able to get stack traces in some 'debug' mode, I really need it much for my day-to-day work. Trying to summarize my day-to-day work, I think I browse tens of traces a day on average (maybe more), some of which are from panics but a significant part of these are from dataflow errors. Losing that capability will make it harder to implement new features and will slow us down. |
fefb7e7
to
4849ef9
Compare
@@ -1877,8 +1877,9 @@ class RuntimeVisualizationsTest | |||
message = | |||
"Method `does_not_exist` of type Main could not be found.", | |||
stack = Vector( | |||
Api.StackTraceElement("<eval>", None, None, None), | |||
Api.StackTraceElement("Debug.eval", None, None, None) | |||
// empty stack for now |
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.
Unfortunate change. Result of trying to unify working with stacktraces behind InteropLibrary
. Let's see if it can be somewhat mitigated tomorrow.
We have four FAILED tests in |
Benchmark run indicates the Previously it took |
Since 10a8452 the following from Standard.Base import all
import Standard.Base.Errors.Illegal_Argument.Illegal_Argument
deep n = if n <= 0 then Error.throw (Illegal_Argument.Error "Problem") else deep n-1
main =
d = deep 10
d.get_stack_trace_text produces just: $ enso --run x.enso
at <enso> x.deep<arg-1>(x.enso:4:25-70) and full thread dump when executed with assertions: $ JAVA_OPTS=-ea enso --run x.enso
at <enso> x.deep<arg-1>(x.enso:4:25-70)
at <enso> x.deep(x.enso:4:10-84)
at <enso> x.deep<arg-2>(x.enso:4:77-84)
at <enso> x.deep(x.enso:4:10-84)
at <enso> x.deep<arg-2>(x.enso:4:77-84)
at <enso> x.deep(x.enso:4:10-84)
at <enso> x.deep<arg-2>(x.enso:4:77-84)
at <enso> x.deep(x.enso:4:10-84)
at <enso> x.deep<arg-2>(x.enso:4:77-84)
at <enso> x.deep(x.enso:4:10-84)
at <enso> x.deep<arg-2>(x.enso:4:77-84)
at <enso> x.deep(x.enso:4:10-84)
at <enso> x.deep<arg-2>(x.enso:4:77-84)
at <enso> x.deep(x.enso:4:10-84)
at <enso> x.deep<arg-2>(x.enso:4:77-84)
at <enso> x.deep(x.enso:4:10-84)
at <enso> x.deep<arg-2>(x.enso:4:77-84)
at <enso> x.deep(x.enso:4:10-84)
at <enso> x.deep<arg-2>(x.enso:4:77-84)
at <enso> x.deep(x.enso:4:10-84)
at <enso> x.deep<arg-2>(x.enso:4:77-84)
at <enso> x.deep(x.enso:4:10-84)
at <enso> x.main(x.enso:7:9-15) I believe this addresses Radek's complain - or at least provides the basics to mitigate it for now. |
engine/runtime/src/test/java/org/enso/interpreter/test/FindExceptionMessageTest.java
Outdated
Show resolved
Hide resolved
@@ -76,7 +76,7 @@ spec = | |||
|
|||
Test.group "Enso_User - local mock integration tests" pending=pending_has_url <| | |||
# These tests should be kept in sync with tools/http-test-helper/src/main/java/org/enso/shttp/cloud_mock/UsersHandler.java | |||
Test.specify "current user can be fetched from mock API" <| | |||
Test.specify "current user can be fetched from mock API" pending=pending_has_url <| |
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.
Sorry I missed that 🤦
I fixed that in the #8591 PR which has been merged recently.
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.
Changes look good.
Thank you very much for addressing my concerns and ensuring that developer UX is not significantly worsened - the debug mode will really be invaluable for us!
The performance improvements are awesome (expectably 🙂).
I have a suggestion (for another followup PR perhaps). Given that we have the I think it could be good to give us control over whether a given error will hold the trace or not - this way we can decide when we want better performance vs better diagnostics. I think there are definitely places where both make sense:
I think this could be the best compromise we can get. |
Certainly a follow up PR and issue. Feel free to record it/implement it.
Yes, I was also thinking about
The issue is:
I was rather thinking about something associated with |
Pull Request Description
Fixes #8137 by storing only
Error.throw
location inDataflowError
. There is agetStackTrace
message inInteropLibrary
, so using it to take full control over theDataflowError
stacktrace.Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
Runtime*Test
have been updated