vrozov commented on code in PR #52630:
URL: https://github.com/apache/spark/pull/52630#discussion_r2434240220
##########
connector/kinesis-asl/src/test/scala/org/apache/spark/streaming/kinesis/KPLBasedKinesisTestUtils.scala:
##########
@@ -63,15 +63,17 @@ private[kinesis] class KPLDataGenerator(regionName: String)
extends KinesisDataG
override def onSuccess(result: UserRecordResult): Unit = {
val shardId = result.getShardId
- val seqNumber = result.getSequenceNumber()
+ val seqNumber = result.getSequenceNumber
val sentSeqNumbers = shardIdToSeqNumbers.getOrElseUpdate(shardId,
new ArrayBuffer[(Int, String)]())
sentSeqNumbers += ((num, seqNumber))
}
}
- Futures.addCallback(future, kinesisCallBack,
ThreadUtils.sameThreadExecutorService())
+ Futures.addCallback(future, kinesisCallBack, executor)
}
producer.flushSync()
- shardIdToSeqNumbers.toMap.transform((_, v) => v.toSeq)
+ executor.shutdown()
Review Comment:
It is not sufficient to flush producer, it is necessary to wait for all
callbacks to be processed. Previously they were called on the producer
execution pool and required synchronization (that was missing).
--
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]