Github user mridulm commented on a diff in the pull request:
https://github.com/apache/spark/pull/228#discussion_r10949472
--- Diff: core/src/main/scala/org/apache/spark/Accumulators.scala ---
@@ -43,8 +44,10 @@ class Accumulable[R, T] (
param: AccumulableParam[R, T])
extends Serializable {
- val id = Accumulators.newId
- @transient private var value_ = initialValue // Current value on master
+ val id = Accumulators.nextAccumID.get()
+ Accumulators.nextAccumID.getAndIncrement
--- End diff --
I am not sure why id would be called twice - it is initialized only once.
Also, the id is just a unique identifier - we are not trying to ensure it
is conserved, but the current code in PR is MT-unsafe w.r.t uniqueness
requirement for id.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---