Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
The UimacppServiceManagement code fails when remote C++ service terminates. The java code logs the following stack trace:
> UimacppServiceManagement service reports shutdown DONE
> UimacppShutdownHook sending quiesce message
> java.net.SocketException: Socket is closed
> at java.net.Socket.getInputStream(Socket.java:903)
> at
> org.apache.uima.aae.controller.UimacppServiceManagement.
> quiesceAndStop(Uima
> cppServiceManagement.java:88)
> at
> org.apache.uima.aae.controller.UimacppServiceManagement.
> quiesceAndShutdown(
> UimacppServiceManagement.java:397)
> at
> org.apache.uima.aae.controller.UimacppShutdownHook.run(
> UimacppServiceController.java:1105)
The UimacppServiceManagement is a communication wrapper which is used by UimacppServiceController to interact with a remote C++ process. It sends text commands to the remote using a Socket.
In quiesceAndStop() the code sends "QUIESCEANDSTOP" command and a remote process exits immediately. After sending the command, the UimacppServiceManagement tries to read from a socket that was closed causing the exception.
Modify code to catch SocketException and log a short message instead of dumping stack trace and returning an exception. Process terminating quickly should not be considered an error.