From 3c4ed9cbe3a60ea72d2a2fb727576168d3f49b7b Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 28 Dec 2018 13:47:18 +0100 Subject: [PATCH] db/update/InotifyQueue: catch UpdateService::Enqueue() exceptions --- NEWS | 1 + src/db/update/InotifyQueue.cxx | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index e189a6b6e..5a3da39db 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,6 @@ ver 0.21.4 (not yet released) * database + - inotify: fix crash bug "terminate called after throwing ..." - upnp: implement "list ... group" * output - httpd: declare protocol "HTTP/1.1" instead of "ICY" diff --git a/src/db/update/InotifyQueue.cxx b/src/db/update/InotifyQueue.cxx index 5ce9a2e02..5dd97690a 100644 --- a/src/db/update/InotifyQueue.cxx +++ b/src/db/update/InotifyQueue.cxx @@ -39,7 +39,15 @@ InotifyQueue::OnDelay() noexcept while (!queue.empty()) { const char *uri_utf8 = queue.front().c_str(); - id = update.Enqueue(uri_utf8, false); + try { + id = update.Enqueue(uri_utf8, false); + } catch (...) { + FormatError(std::current_exception(), + "Failed to enqueue '%s'", uri_utf8); + queue.pop_front(); + continue; + } + if (id == 0) { /* retry later */ delay_event.Schedule(INOTIFY_UPDATE_DELAY);