schlosna commented on code in PR #38781:
URL: https://github.com/apache/spark/pull/38781#discussion_r1033091561


##########
core/src/main/scala/org/apache/spark/SparkContext.scala:
##########
@@ -2570,10 +2570,23 @@ class SparkContext(config: SparkConf) extends Logging {
 
   private[spark] def newShuffleId(): Int = nextShuffleId.getAndIncrement()
 
-  private val nextRddId = new AtomicInteger(0)
+  private var nextRddId = new AtomicInteger(0)

Review Comment:
   What happens when the RDD ID overflows within a SparkContext? Are there 
tests that cover these cases?
   
   Curious if it would be better to switch to an AtomicLong and just modulo max 
int?
   
   ```suggestion
     private[spark] def newRddId(): Int = (nextRddId.getAndIncrement() % 
Integer.MAX_VALUE).toInt
   ```
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to