Our solr indexes are refreshed according to a schedule, as well as arbitrarily as needed by means of a DataImportHandler full import. We've had several occasions where the import fails for various reasons.
How can I receive a notification (preferably email) that an error has occured while performing an import with a DataImportHandler?
After attempting to use an EventListener with some success we reviewed our options and ultimately settled on a less-than-foolproof approach.
Instead of extending Solr we're using our existing monitoring infrastructure (primarily with Nagios) to poll the status of the dataimporthandler
. It runs every minute and alerts us via our normal channels if it detects a failed import. This is good, but it still fails to detect if jobs aren't running at all--and has missed a few other corner cases.
Overall though this works well enough for now. It uses our existing infrastructure and keeps our efforts around Solr limited to its core functionality. I'll definately be revisiting this when we finally make the upgrade to Solr 4.0.