-
Notifications
You must be signed in to change notification settings - Fork 51
Add ExecutorPlugin methods called on Task Start/End #713
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
Conversation
| // Static value modified by testing plugins to ensure plugins are called correctly. | ||
| public static int numOnTaskStart = 0; | ||
| public static int numOnTaskSucceeded = 0; | ||
| public static int numOnTaskFailed = 0; |
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.
Apologies, not following. Why is non-static insufficient to ensure that?
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 could, I was following the pattern of https://github.com/palantir/spark/blob/master/core/src/test/java/org/apache/spark/ExecutorPluginSuite.java#L35. I think this is a preference thing, and I particularly would rather have these be variables in each plugin. Will refactor such this is the case.
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.
Actually, we need a static variable because we don't have access to the instances of the plugin being instantiated here (plugins are instantiated on the spark executors). The way upstream does now is a bit more verbose, but still relies on static variables... this is a bit simpler, so will leave like this.
core/src/test/scala/org/apache/spark/scheduler/TaskContextSuite.scala
Outdated
Show resolved
Hide resolved
rshkv
left a comment
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.
Very cool! I left some minor comments but can merge as-is.
a19df5e to
42d60c2
Compare
Upstream SPARK-33088 ticket and apache#29977
Done.
What changes were proposed in this pull request?
Add a set of endpoints on
ExecutorPluginwhich are called on the lifecycle of aTask. Main usage of such endpoints is for tracing purposes, i.e. to propagate the inbound tracing information fromTaskContext#getLocalPropertiesto a tracing framework of choice (in our case, https://github.com/palantir/tracing-java/).How was this patch tested?
Unit tests on
ExecutorPluginTaskSuite.Please review http://spark.apache.org/contributing.html before opening a pull request.