Skip to content

Improve AlreadyClosedException logging [LUCENE-10005] #11044

@asfimport

Description

@asfimport

If we close the IndexWriter because of a tragic exception and later try to write into the index we got AlreadyClosedException exception like this:

2021-05-17 11:35:04,963 ERROR (qtp626742236-67894)----x:ct_returns_shard8_replica_n28-o.a.s.s.HttpSolrCall: null:org.apache.solr.common.SolrException: Error handling 'MERGEINDEXES' action
        at org.apache.solr.handler.admin.CoreAdminOperation.execute(CoreAdminOperation.java:365)
        ...
Caused by: org.apache.lucene.store.AlreadyClosedException: this IndexWriter is closed
        at org.apache.lucene.index.IndexWriter.ensureOpen(IndexWriter.java:671)
        at org.apache.lucene.index.IndexWriter.ensureOpen(IndexWriter.java:685)
        ...
Caused by: org.apache.hadoop.hdfs.BlockMissingException: Could not obtain block: BP-1877842388-10.181.61.226-1618590425462:blk_1075816117_2075498 file=/solr/ct_returns/core_node31/data/index/_1z_Lucene50_0.doc
        at org.apache.hadoop.hdfs.DFSInputStream.refetchLocations(DFSInputStream.java:880)
        at org.apache.hadoop.hdfs.DFSInputStream.chooseDataNode(DFSInputStream.java:863)
        at  

This is rather misleading because 2021-05-17 is the date of the AlreadyClosedException, but the tragic exception (BlockMissingException in this case) could be much earlier. This is the exception we saved when we had to close the indexwriter.
 
We should emphasise that the tragic exception is not a fresh exception, but an exception we saved earlier.


Migrated from LUCENE-10005 by Andras Salamon (@asalamon74), updated Jun 17 2021

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions