You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tika.apache.org by ta...@apache.org on 2024/02/06 21:12:01 UTC

(tika) branch main updated: TIKA-4189 -- CallablePipesIterator should wait for timeoutMillis when trying to offer the final semaphore (#1577)

This is an automated email from the ASF dual-hosted git repository.

tallison pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tika.git


The following commit(s) were added to refs/heads/main by this push:
     new d86b7d6a0 TIKA-4189 -- CallablePipesIterator should wait for timeoutMillis when trying to offer the final semaphore (#1577)
d86b7d6a0 is described below

commit d86b7d6a0e88d9efffa56f2409fc33d088da12c0
Author: Tim Allison <ta...@apache.org>
AuthorDate: Tue Feb 6 16:11:57 2024 -0500

    TIKA-4189 -- CallablePipesIterator should wait for timeoutMillis when trying to offer the final semaphore (#1577)
---
 .../org/apache/tika/pipes/pipesiterator/CallablePipesIterator.java  | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tika-core/src/main/java/org/apache/tika/pipes/pipesiterator/CallablePipesIterator.java b/tika-core/src/main/java/org/apache/tika/pipes/pipesiterator/CallablePipesIterator.java
index 6bde42ba0..a60784f0c 100644
--- a/tika-core/src/main/java/org/apache/tika/pipes/pipesiterator/CallablePipesIterator.java
+++ b/tika-core/src/main/java/org/apache/tika/pipes/pipesiterator/CallablePipesIterator.java
@@ -97,9 +97,11 @@ public class CallablePipesIterator implements Callable<Long> {
                 added++;
             }
             for (int i = 0; i < numConsumers; i++) {
-                boolean offered = queue.offer(PipesIterator.COMPLETED_SEMAPHORE);
+                boolean offered = queue.offer(PipesIterator.COMPLETED_SEMAPHORE, timeoutMillis,
+                        TimeUnit.MILLISECONDS);
                 if (!offered) {
-                    throw new TimeoutException("timed out trying to offer tuple");
+                    throw new TimeoutException("timed out trying to offer the completed " +
+                            "semaphore");
                 }
             }
         } else {