kfaraz commented on code in PR #13296:
URL: https://github.com/apache/druid/pull/13296#discussion_r1011128725


##########
indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/RecordSupplierInputSource.java:
##########
@@ -123,13 +129,23 @@ CloseableIterator<InputEntity> createEntityIterator()
       private Iterator<OrderedPartitionableRecord<PartitionIdType, 
SequenceOffsetType, RecordType>> recordIterator;
       private Iterator<? extends ByteEntity> bytesIterator;
       private volatile boolean closed;
+      private long createTime = System.currentTimeMillis();
+      private Long terminationTime = samplerConfigTimeoutMs != null ? 
createTime + samplerConfigTimeoutMs : null;
 
       private void waitNextIteratorIfNecessary()
       {
         while (!closed && (bytesIterator == null || !bytesIterator.hasNext())) 
{
           while (!closed && (recordIterator == null || 
!recordIterator.hasNext())) {
+            if (terminationTime != null) {
+              if (System.currentTimeMillis() > terminationTime) {
+                LOG.info("Configured sampler timeout has been exceeded, 
returning without a bytesIterator.");

Review Comment:
   Nit: Maybe also log the value of the `timeoutMs`?



-- 
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