After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 734144 - Tracker processes fail to respond to INT or TERM while initialising
Tracker processes fail to respond to INT or TERM while initialising
Status: RESOLVED FIXED
Product: tracker
Classification: Core
Component: General
git master
Other Linux
: Normal minor
: ---
Assigned To: tracker-general
Depends on:
Blocks:
 
 
Reported: 2014-08-01 21:47 UTC by Sam Thursfield
Modified: 2014-08-06 20:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
tracker-extract: Use default signal handler for SIGALRM and SIGABRT (1.34 KB, patch)
2014-08-01 21:48 UTC, Sam Thursfield
accepted-commit_now Details | Review
Processes shouldn't install the signal handler until the main loop starts (4.16 KB, patch)
2014-08-01 21:48 UTC, Sam Thursfield
accepted-commit_now Details | Review

Description Sam Thursfield 2014-08-01 21:47:10 UTC
Patches attached (also in branch sam/signal-handling)
Comment 1 Sam Thursfield 2014-08-01 21:48:05 UTC
Created attachment 282294 [details] [review]
tracker-extract: Use default signal handler for SIGALRM and SIGABRT

The ALRM handler was introduced in commit
d9d1881c2548e5d6d55fad1e897f8f058ef28696. The alarm() function seems to
no longer be used, so we can remove it.

The ABRT handler was introduced in commit
3f42a4390d48c6a4840a7bcfce74673ebfd23479. I'm not sure of the reason.
Other Tracker processes use the default handler for ABRT, so let's be
consistent.
Comment 2 Sam Thursfield 2014-08-01 21:48:26 UTC
Created attachment 282295 [details] [review]
Processes shouldn't install the signal handler until the main loop starts

The signal handler we install calls g_main_loop_quit() when SIGTERM or SIGINT
are raised, but this is only useful if the loop was started. Sending SIGTERM or
SIGINT to a Tracker process while it is starting up fails to stop the process,
and triggers the following a warning:

  GLib-CRITICAL **: g_main_loop_quit: assertion 'loop != NULL' failed

Ideally we'd call initialize_signal_handler from an idle once the main
loop has started, but installing it just before the loop starts should
be a big improvement.
Comment 3 Martyn Russell 2014-08-06 08:01:18 UTC
Comment on attachment 282294 [details] [review]
tracker-extract: Use default signal handler for SIGALRM and SIGABRT

Thanks Sam, yes IIRC, this was all to handle dodgy PDF file extraction which could take a long time.
Comment 4 Martyn Russell 2014-08-06 08:02:28 UTC
Comment on attachment 282295 [details] [review]
Processes shouldn't install the signal handler until the main loop starts

Thanks again, you can feel free to just commit these sort of things in the future ;) Same with the signal handler clean up patch! - Just ask for bug review on major feature branches - I will complain if you break anything anyway :P
Comment 5 Sam Thursfield 2014-08-06 20:33:58 UTC
cheers Martyn, a review of this is helpful for me because I didn't really know why half of that stuff was actually there ! Merged now.