The ApiServlet uses java.util.concurrent.Future in the same way as the ConcurrentPreloaderService, although in the default implementation the Future is an ImmediateFuture. In production, sites may use a real concurrent Future and so will hit the same issue as the failed test, which is related to inter thread communication that is using the flag, Hence my reluctance to make a modification.

So, do you have a patch that manages the interruption to the Future tasks correctly ?

On 20 Nov 2008, at 06:20, Mathias Bogaert (JIRA) wrote:


[ https://issues.apache.org/jira/browse/SHINDIG-707?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12649376 #action_12649376 ]

Mathias Bogaert commented on SHINDIG-707:
-----------------------------------------

I haven't looked at the whole ConcurrentPreloaderServiceTest issue, but it seems like someone wants to terminate the running thread. Marking a thread as interrupted should not cause the unit tests to fail.

If Shindig's Servlet container (Jetty, Tomcat, or any other server) it servicing RESTful requests, and it's being asked to terminate itself, thread pools will need to interrupt their threads. Therefore it's important that no threads are kept 'alive' by a client since the interrupted flag was cleared.

ApiServlet clears interrupted flag
----------------------------------

               Key: SHINDIG-707
               URL: https://issues.apache.org/jira/browse/SHINDIG-707
           Project: Shindig
        Issue Type: Improvement
Components: Gadget Rendering Server (Java), RESTful API (Java)
          Reporter: Mathias Bogaert
          Assignee: Ian Boston

} catch (InterruptedException ie) {
     response = responseItemFromException(ie);
Should be
} catch (InterruptedException ie) {
     response = responseItemFromException(ie);
     // Restore the interrupted status
     Thread.currentThread().interrupt();
Reference:
http://www-128.ibm.com/developerworks/java/library/j-jtp05236.html

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