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

Steve Rowe commented on SOLR-4839:
----------------------------------

[~ehatcher] told me offline, and I confirmed, that the directory 
{{solr/server/solr-webapp/}} was being deleted when Solr is run from a trunk 
checkout.  In {{solr/server/contexts/solr-jetty-context.xml}}, we tell Jetty to 
use this directory as its {{tempDirectory}}.

[~hossman_luc...@fucit.org] told me offline that he suspected that [Jetty 9's 
new option to persist its temp directory 
({{persistTempDirectory}})|http://www.eclipse.org/jetty/documentation/9.2.6.v20141205/ref-temporary-directories.html#d0e3831],
 which defaults to {{false}}, was causing this problem: when Jetty shuts down 
gracefully and this option is not set to {{true}}, its temp dir is deleted.

I verified that this is the case: after {{ant example}} and {{bin/solr start}}, 
{{solr/server/solr-webapp/}} holds the exploded war, but after {{bin/solr 
stop}}, {{solr/server/solr-webapp}} ceases to exist.

When I add the following inside the {{<Configure>}} tag in 
{{solr-jetty-context.xml}}, the temp dir and the exploded war contained within 
are left intact after {{bin/solr stop}}:

{code:xml}
  <Set name="persistTempDirectory">true</Set>
{code}

I think the above addition is the way to go.

Alternatively, to preserve the {{solr/server/solr-webapp/}} directory, we could 
tell Jetty to use a sub-directory, but leave the temp dir persistence option at 
false - I tested this and it worked - when I changed the {{tempDirectory}} 
setting to include a sub-directory named {{tempdir/}} as shown below, the 
sub-directory was created at startup and deleted at shutdown, leaving the 
parent directory intact:

{code:xml}
  <Set name="tempDirectory"><Property name="jetty.base" 
default="."/>/solr-webapp/tempdir</Set>
{code}

If there are no objections, I'll add the {{persistTempDir=true}} setting to 
{{solr-jetty-context.xml}} tomorrow.

> Jetty 9
> -------
>
>                 Key: SOLR-4839
>                 URL: https://issues.apache.org/jira/browse/SOLR-4839
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Bill Bell
>            Assignee: Shalin Shekhar Mangar
>             Fix For: 5.0, Trunk
>
>         Attachments: SOLR-4839-fix-eclipse.patch, SOLR-4839.patch, 
> SOLR-4839.patch, SOLR-4839.patch, SOLR-4839.patch, SOLR-4839.patch, 
> SOLR-4839.patch, SOLR-4839.patch, SOLR-4839.patch, SOLR-4839.patch
>
>
> Implement Jetty 9



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to