You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Frank Wesemann <f....@fotofinder.net> on 2011/06/15 16:40:32 UTC

DIH abort doesn't close datasources

Hi,
I just came across this:
If I abort an import via /dataimport/?command=abort the connections to 
the (in my case) database stay open.
Shouldn't DocBuilder#rollback() call something like cleanup() which in 
turn tries to close EntityProcessors, Datasources etc.
instead of relying that finalize() will sometimes do it's job?


-- 
mit freundlichem Gruß,

Frank Wesemann
Fotofinder GmbH         USt-IdNr. DE812854514
Software Entwicklung    Web: http://www.fotofinder.com/
Potsdamer Str. 96       Tel: +49 30 25 79 28 90
10785 Berlin            Fax: +49 30 25 79 28 999

Sitz: Berlin
Amtsgericht Berlin Charlottenburg (HRB 73099)
Geschäftsführer: Ali Paczensky




Re: DIH abort doesn't close datasources

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
On Thu, Jun 16, 2011 at 3:46 PM, Frank Wesemann
<f....@fotofinder.net>wrote:

> Shalin,
> thank you for the answer.
> I indeed didn't look into clearCache().
> I thought it would just do that ( clear caches ). :)
>

Yeah, it is not the most aptly named method :)

Thanks for reviewing the code though!

-- 
Regards,
Shalin Shekhar Mangar.

Re: DIH abort doesn't close datasources

Posted by Frank Wesemann <f....@fotofinder.net>.
Shalin,
thank you for the answer.
I indeed didn't look into clearCache().
I thought it would just do that ( clear caches ). :)

Shalin Shekhar Mangar schrieb:
> The abort command just sets a atomic boolean flag which is checked
> frequently by the import threads to see if they should stop. If you look at
> the DataImport.java's doFullImport or doDeltaImport methods, you'll see that
> config.clearCaches is the clean up method which is called in a finally
> block. So the data sources should be closed once the import actually aborts.
> Note that there may be a time lag between calling the abort method and the
> import actually getting abort if the import threads are waiting for I/O.
>
>   


-- 
mit freundlichem Gruß,

Frank Wesemann
Fotofinder GmbH         USt-IdNr. DE812854514
Software Entwicklung    Web: http://www.fotofinder.com/
Potsdamer Str. 96       Tel: +49 30 25 79 28 90
10785 Berlin            Fax: +49 30 25 79 28 999

Sitz: Berlin
Amtsgericht Berlin Charlottenburg (HRB 73099)
Geschäftsführer: Ali Paczensky




Re: DIH abort doesn't close datasources

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
On Wed, Jun 15, 2011 at 8:10 PM, Frank Wesemann
<f....@fotofinder.net>wrote:

> Hi,
> I just came across this:
> If I abort an import via /dataimport/?command=abort the connections to the
> (in my case) database stay open.
> Shouldn't DocBuilder#rollback() call something like cleanup() which in turn
> tries to close EntityProcessors, Datasources etc.
> instead of relying that finalize() will sometimes do it's job?
>
>
The abort command just sets a atomic boolean flag which is checked
frequently by the import threads to see if they should stop. If you look at
the DataImport.java's doFullImport or doDeltaImport methods, you'll see that
config.clearCaches is the clean up method which is called in a finally
block. So the data sources should be closed once the import actually aborts.
Note that there may be a time lag between calling the abort method and the
import actually getting abort if the import threads are waiting for I/O.

-- 
Regards,
Shalin Shekhar Mangar.