[ 
https://issues.apache.org/jira/browse/SOLR-1089?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12693520#action_12693520
 ] 

Lance Norskog commented on SOLR-1089:
-------------------------------------

The servlet spec used to ban creating background threads inside servlets. I 
can't find that in the 2.5 spec, but it is generally a bad idea.

http://jcp.org/aboutJava/communityprocess/mrel/jsr154/index2.html

There is a problem with the servlet.destroy() method: it should pause until the 
index update finishes. Servlet sessions can be persisted and reloaded by the 
servlet container. This is supported so that, for example, for migrating 
sessions across web servers to allow a login session to continue across server 
crashes. There is also some listener interface for when the web app is 
undeployed.

It is ok to break this rule, but please make it optional and not the default 
behavior. It is a land mine: it will almost certainly cause some weird problem 
on some servlet engine.

Lance

>From the 2.5 servlet spec:

SRV.2.3.4 End of Service
The servlet container is not required to keep a servlet loaded for any 
particular
period of time. A servlet instance may be kept active in a servlet container 
for a
period of milliseconds, for the lifetime of the servlet container (which could 
be a
number of days, months, or years), or any amount of time in between.
When the servlet container determines that a servlet should be removed from
service, it calls the destroy method of the Servlet interface to allow the 
servlet to
release any resources it is using and save any persistent state. For example, 
the
container may do this when it wants to conserve memory resources, or when it is
being shut down.
Before the servlet container calls the destroy method, it must allow any
threads that are currently running in the service method of the servlet to 
complete
execution, or exceed a server-defined time limit.

Once the destroy method is called on a servlet instance, the container may
not route other requests to that instance of the servlet. If the container 
needs to
enable the servlet again, it must do so with a new instance of the servlet's 
class.
After the destroy method completes, the servlet container must release the
servlet instance so that it is eligible for garbage collection.




> do write to Solr in a separate thread
> -------------------------------------
>
>                 Key: SOLR-1089
>                 URL: https://issues.apache.org/jira/browse/SOLR-1089
>             Project: Solr
>          Issue Type: Improvement
>          Components: contrib - DataImportHandler
>            Reporter: Noble Paul
>         Attachments: SOLR-1089.patch
>
>
> import can be made faster if the write is done in a different thread

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