Crash in queueRequest
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
thumbnailer (Ubuntu) |
Fix Released
|
High
|
Michi Henning |
Bug Description
https:/
We hit this occasionally, but not very often. I suspect it is because of the way we shut down: we destroy the thumbnailer instance before the dbus interface so we don't hit the race condition where one instance of the service still has the database lock while a second instance of the service is activated by a new incoming request. But, destroying the thumbnailer first means that, if a request arrives at just the right time, the dbu sinterface fires the request at the already-destroyed thumbnailer.
I recently hit a whole slew of issues in a test that destroyed the thumbnailer and dbus interface (in that order) while there were still requests sitting in the scheduler and thread pools, and fixed a bunch of these issues (see the request-
I think the best solution would be to add a shutdown() method to the dbus interface that prevents new requests from firing. We also need some way to wait for all *received* (not just scheduled) requests to finish executing before physically shutting down.
Does DBus have a way to say "I'm in the process of shutting down. Send the request that just arrived and that I can't process anymore to a new instance of the service"? Ideally, I would like to "close the gate" on incoming requests such that they are transparently re-sent, and then wait for all currently executing requests to finish processing.
Related branches
- James Henstridge: Approve
- PS Jenkins bot (community): Approve (continuous-integration)
-
Diff: 532 lines (+179/-51)10 files modifieddebian/changelog (+3/-0)
src/image.cpp (+11/-0)
src/service/admininterface.cpp (+4/-4)
src/service/admininterface.h (+2/-2)
src/service/dbusinterface.cpp (+4/-4)
src/service/dbusinterface.h (+4/-5)
src/service/handler.cpp (+37/-17)
src/service/main.cpp (+1/-6)
src/thumbnailer.cpp (+3/-1)
tests/stress/stress_test.cpp (+110/-12)
- James Henstridge: Approve
- PS Jenkins bot (community): Approve (continuous-integration)
-
Diff: 481 lines (+366/-3)9 files modifiedinclude/internal/file_lock.h (+64/-0)
src/CMakeLists.txt (+1/-0)
src/file_lock.cpp (+110/-0)
src/service/handler.h (+1/-1)
src/service/main.cpp (+33/-2)
tests/CMakeLists.txt (+1/-0)
tests/file_lock/CMakeLists.txt (+9/-0)
tests/file_lock/file_lock_test.cpp (+116/-0)
tests/file_lock/hold_lock.cpp (+31/-0)
Changed in thumbnailer: | |
importance: | Undecided → High |
description: | updated |
Changed in thumbnailer (Ubuntu): | |
importance: | Undecided → High |
no longer affects: | thumbnailer |
Changed in thumbnailer (Ubuntu): | |
assignee: | nobody → Michi Henning (michihenning) |
status: | Confirmed → In Progress |
Changed in thumbnailer (Ubuntu): | |
status: | In Progress → Fix Committed |
Changed in thumbnailer (Ubuntu): | |
status: | Fix Committed → Fix Released |
There is an ancient thread about this here: https:/ /bugs.freedeskt op.org/ show_bug. cgi?id= 11454
Another related discussion: http:// comments. gmane.org/ gmane.comp. freedesktop. dbus/11549
Doesn't look like we can do what we need. It appears to be impossible to shut down without at least causing an error on the client side.