anishshri-db commented on code in PR #50595: URL: https://github.com/apache/spark/pull/50595#discussion_r2065118202
########## sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/StateStore.scala: ########## @@ -1111,60 +1160,46 @@ object StateStore extends Logging { } } + // Wait until this partition can be processed + private def awaitProcessThisPartition( + id: StateStoreProviderId, + timeoutMs: Long + ): Boolean = { + val endTime = System.currentTimeMillis() + timeoutMs + + // If immediate processing fails, wait with timeout + var canProcessThisPartition = processThisPartition(id) + while (!canProcessThisPartition && System.currentTimeMillis() < endTime) { + canProcessThisPartition = processThisPartition(id) + Thread.sleep(5000) Review Comment: Lets not do a busy wait here ? can we do a cond wait/signal as needed -- 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: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org