lucene-solr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lance Norskog (JIRA)" <>
Subject [jira] Commented: (SOLR-1089) do write to Solr in a separate thread
Date Sun, 29 Mar 2009 05:20:52 GMT


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.

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.


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

View raw message