elasticsearch-river-mongodb icon indicating copy to clipboard operation
elasticsearch-river-mongodb copied to clipboard

Infinitive loop in MongoDBRiver.java

Open ewgRa opened this issue 10 years ago • 1 comments

We face with problem when river freeze on RUNNING status and there is no any inserts to elastic search. For now I try to debug where is a problem and found in MongoDBRiver.java this code:

                    while (true) {
                        try {
                            config = configProvider.call();
                            break;
                        } catch(MongoSocketException | MongoTimeoutException e) {
                            Thread.sleep(MONGODB_RETRY_ERROR_DELAY_MS);
                        }
                    }

Seems this is infinitive loop when there is no connection to Mongodb? Maybe good idea try it several times and then mark river as failed and throw network exception and point to which one address it try to connect?

ewgRa avatar Feb 19 '15 09:02 ewgRa

Seems this needed when river works and network gone and then restored.

Maybe on this state set river status to "TRY_TO_CONNECT"?

For now people install river and see zombie running rivers and there is no explanations why it happens. Also as working river when mongo is down show status as RUNNING, but actually they are zombie.

On initial import mark river as failed when there is no connection, and on usual river work just write to logs warning message, that mongodb is unreachable, mark river as "TRY_TO_CONNECT". In this case we will haven't zombie RUNNING rivers and have good exmplanations in logs.

ewgRa avatar Feb 19 '15 10:02 ewgRa