PILLUTLAAVINASH / google-enterprise-connector-manager

Automatically exported from code.google.com/p/google-enterprise-connector-manager
0 stars 0 forks source link

Try to avoid calling Connector classes from an interrupted thread #89

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a Dctm connector that will feed a very large file - example was a
200+MB zip file.
2. File takes over 6 minutes to send over to the GSA
3. Look for "WARNING: Replacing work queue thread: WorkQueueThread-x" in
the logs.

What is the expected output? What do you see instead?

In the QueryTraverser.doWork() the interrupted thread state should be
detected between the call to get the nextDocument() and the call to send
the document to the DocPusher and the thread should exit gracefully.

Instead, it appears the call to the Dctm implementation of
DocumentList.nextDocument() is toggling the Thread interrupted state so
it's not detected - even thought the Thread has been interrupted the
document is pushed.

Please use labels and text to provide additional information.

To prevent the risk of the Connector implementation changing the
Thread.interrupted() state it should be checked before the call to
nextDocument().

Original issue reported on code.google.com by mgron...@gmail.com on 12 May 2008 at 6:01

Attachments:

GoogleCodeExporter commented 8 years ago
r797 | mgronber | 2008-05-16 15:21:07 -0700 (Fri, 16 May 2008) | 22 lines

Issue 89: Try to avoid calling Connector classes from an interrupted thread

Moved the check for thread state, changed to use isInterrupted() to preserve
state, added some logging and added a test for WorkQueueThread.

ChangeLog:
----------
* java/com/google/enterprise/connector/common/WorkQueue.java:
* java/com/google/enterprise/connector/scheduler/TraversalScheduler.java:
  - Added extra logging.

* source/java/com/google/enterprise/connector/common/WorkQueueThread.java:
  - Fixed problem where the thread would only exit if it was in the wait state.

* java/com/google/enterprise/connector/traversal/QueryTraverser.java:
  - Move the test for Thread.interrupted() to a point before the
    next document is retrieved rather than after.
  - Added extra logging.

* javatests/com/google/enterprise/connector/common/WorkQueueThreadTest.java:
  - Added

Original comment by mgron...@gmail.com on 16 May 2008 at 10:22

GoogleCodeExporter commented 8 years ago

Original comment by mgron...@gmail.com on 19 Jun 2008 at 6:35