-
Notifications
You must be signed in to change notification settings - Fork 166
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
doc: Add initial doc how to expand Comet exceptions #170
Conversation
@snmvaughan cc |
DEBUGGING.md
Outdated
Start Comet with `RUST_BACKTRACE=1` | ||
|
||
```commandline | ||
RUST_BACKTRACE=1 $SPARK_HOME/spark-shell --jars spark/target/comet-spark-spark3.4_2.12-0.1.0-SNAPSHOT.jar --conf spark.sql.extensions=org.apache.comet.CometSparkSessionExtensions --conf spark.comet.enabled=true --conf spark.comet.exec.enabled=true --conf spark.comet.exec.all.enabled=true |
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.
Just curious, if we don't enable RUST_BACKTRACE=1
, is there any performance penalty from enabling backtrace
?
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.
Same here. If there's no penalty without enabling RUST_BACKTRACE=1
, I think we can build with backtrace enabled and disabled it at runtime.
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.
Just curious, if we don't enable
RUST_BACKTRACE=1
, is there any performance penalty from enablingbacktrace
?
We had some discussion back in the day on this apache/datafusion#7522 (comment)
The problem was with analyzer, and in Comet we use physical plan, however it might still have some overhead IMHO, as it has to call Backtrace::enabled
function which will def take some cpu cycles
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.
wow, thanks for this doc. I think it's super useful.
DEBUGGING.md
Outdated
``` | ||
Note: | ||
- The backtrace coverage in Datafusion is still improving. So there is a chance the error still not covered, feel free to file a [ticket](https://github.com/apache/arrow-datafusion/issues) | ||
- The backtrace doesn't come for free and therefore intended for debugging purposes |
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.
Curious to know, what percentage of overhead are we talking about? Like 1%, 5% or something 10%?
DEBUGGING.md
Outdated
To do that with Comet it is needed to enable `backtrace` in https://github.com/apache/arrow-datafusion-comet/blob/main/core/Cargo.toml | ||
|
||
``` | ||
datafusion-common = { version = "36.0.0", features = ["backtrace"] } |
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.
Seems like we should update the cargo.toml to include backtrace feature by default for local/debug build?
DEBUGGING.md
Outdated
Start Comet with `RUST_BACKTRACE=1` | ||
|
||
```commandline | ||
RUST_BACKTRACE=1 $SPARK_HOME/spark-shell --jars spark/target/comet-spark-spark3.4_2.12-0.1.0-SNAPSHOT.jar --conf spark.sql.extensions=org.apache.comet.CometSparkSessionExtensions --conf spark.comet.enabled=true --conf spark.comet.exec.enabled=true --conf spark.comet.exec.all.enabled=true |
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.
Same here. If there's no penalty without enabling RUST_BACKTRACE=1
, I think we can build with backtrace enabled and disabled it at runtime.
DEBUGGING.md
Outdated
Start Comet with `RUST_BACKTRACE=1` | ||
|
||
```commandline | ||
RUST_BACKTRACE=1 $SPARK_HOME/spark-shell --jars spark/target/comet-spark-spark3.4_2.12-0.1.0-SNAPSHOT.jar --conf spark.sql.extensions=org.apache.comet.CometSparkSessionExtensions --conf spark.comet.enabled=true --conf spark.comet.exec.enabled=true --conf spark.comet.exec.all.enabled=true |
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.
A little off the topic. For distributed environments, I believe --conf spark.executorEnv.RUST_BACKTRACE=1
should be passed to make sure executor's JVM is started with backtrace enabled.
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.
That is good idea if we decide to keep backtrace enabled always
If we ok with the initial text lets merge it and I'll create a followup to measure performance with |
DEBUGGING.md
Outdated
@@ -30,6 +30,62 @@ LLDB or the LLDB that is bundled with XCode. We will use the LLDB packaged with | |||
|
|||
_Caveat: The steps here have only been tested with JDK 11_ on Mac (M1) | |||
|
|||
# Expand Comet exception details |
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.
It seems a bit weird to put this between the first paragraph and the section of Debugging for Advanced Developers
which are both talking about IDEs..
How about put this part after Additional Info
?
Otherwise, thos doc LGTM.
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.
LGTM
DEBUGGING.md
Outdated
|
||
``` | ||
|
||
There is a verbose exception option by leveraging Datafusion [backtraces](https://arrow.apache.org/datafusion/user-guide/example-usage.html#enable-backtraces) |
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.
There is a verbose exception option by leveraging Datafusion [backtraces](https://arrow.apache.org/datafusion/user-guide/example-usage.html#enable-backtraces) | |
There is a verbose exception option by leveraging DataFusion [backtraces](https://arrow.apache.org/datafusion/user-guide/example-usage.html#enable-backtraces) |
DEBUGGING.md
Outdated
``` | ||
|
||
There is a verbose exception option by leveraging Datafusion [backtraces](https://arrow.apache.org/datafusion/user-guide/example-usage.html#enable-backtraces) | ||
This option allows to append native Datafusion stacktrace to the original error message. |
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 option allows to append native Datafusion stacktrace to the original error message. | |
This option allows to append native DataFusion stacktrace to the original error message. |
DEBUGGING.md
Outdated
|
||
There is a verbose exception option by leveraging Datafusion [backtraces](https://arrow.apache.org/datafusion/user-guide/example-usage.html#enable-backtraces) | ||
This option allows to append native Datafusion stacktrace to the original error message. | ||
To enable this option with Comet it is needed to include `backtrace` feature in [Cargo.toml](https://github.com/apache/arrow-datafusion-comet/blob/main/core/Cargo.toml) for Datafusion dependencies |
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.
To enable this option with Comet it is needed to include `backtrace` feature in [Cargo.toml](https://github.com/apache/arrow-datafusion-comet/blob/main/core/Cargo.toml) for Datafusion dependencies | |
To enable this option with Comet it is needed to include `backtrace` feature in [Cargo.toml](https://github.com/apache/arrow-datafusion-comet/blob/main/core/Cargo.toml) for DataFusion dependencies |
DEBUGGING.md
Outdated
... | ||
``` | ||
Note: | ||
- The backtrace coverage in Datafusion is still improving. So there is a chance the error still not covered, feel free to file a [ticket](https://github.com/apache/arrow-datafusion/issues) |
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.
- The backtrace coverage in Datafusion is still improving. So there is a chance the error still not covered, feel free to file a [ticket](https://github.com/apache/arrow-datafusion/issues) | |
- The backtrace coverage in DataFusion is still improving. So there is a chance the error still not covered, feel free to file a [ticket](https://github.com/apache/arrow-datafusion/issues). |
DEBUGGING.md
Outdated
``` | ||
Note: | ||
- The backtrace coverage in Datafusion is still improving. So there is a chance the error still not covered, feel free to file a [ticket](https://github.com/apache/arrow-datafusion/issues) | ||
- The backtrace doesn't come for free and therefore intended for debugging purposes |
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.
- The backtrace doesn't come for free and therefore intended for debugging purposes | |
- The backtrace doesn't come for free and therefore intended for debugging purposes. |
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 afraid that "doesn't come for free" reads a bit ambiguous. Maybe change to more explicit way like "The backtrace comes with performance cost ...".
Addressed all the comments, thanks folks for helping with the review. I plan to merge it within 1 hr, if no other comments |
Which issue does this PR close?
Closes #104 .
Rationale for this change
Adding docs how to extend Comet exceptions by leveraging DF backtraces
What changes are included in this PR?
How are these changes tested?