[ 
https://issues.apache.org/jira/browse/UIMA-1109?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12739580#action_12739580
 ] 

Jerry Cwiklik commented on UIMA-1109:
-------------------------------------

When stopping a service via JMX, the service is not stopping due to the fact 
that the main thread is stuck in  a read expecting 'q' or 's'. Below is the 
state of the main thread as show in the JConsole:

Name: main
State: RUNNABLE
Total blocked: 4  Total waited: 1

Stack trace: 
java.io.FileInputStream.readBytes(Native Method)
java.io.FileInputStream.read(FileInputStream.java:199)
java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
java.io.BufferedInputStream.read(BufferedInputStream.java:237)
   - locked java.io.bufferedinputstr...@6f0962
org.apache.uima.adapter.jms.service.UIMA_Service.main(UIMA_Service.java:422)

The current service wrapper uses a blocking read (System.in.read()) to process 
user commands from a command line. This read is not interruptable. The 
UIMA_Service should change to poll for user input and in between polling check 
the state of the service. If the service is stopped dont bother reading from 
stdin and simply terminate the main thread.


> Need ability to quiesce an instance of a service
> ------------------------------------------------
>
>                 Key: UIMA-1109
>                 URL: https://issues.apache.org/jira/browse/UIMA-1109
>             Project: UIMA
>          Issue Type: Improvement
>          Components: Async Scaleout
>            Reporter: Burn Lewis
>            Assignee: Jerry Cwiklik
>
> We can deploy extra instances of a service seamlessly but also need a 
> mechanism to undeploy without losing any work, i.e. ask an instance to stop 
> processing messages and shutdown when it finishes its current work.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to