track16 writes

I’m an ubuntu user on 10.04 (GNOME), and I custom compiled recoll (1.15.7) just now. I’ve used the rclmon.sh script to start up the recollindex process when I login to gnome using gnome’s startup manager. Indexing/search seems to work like a charm; however, I’ve noticed that when I log out of my session, the recollindex process does not die.

I’m aware that there may be some kind of workaround for this issue - perhaps using a different startup mechanism, and letting recollindex determine when to exit.

However, my discovery might point at a deeper issue with not being able to kill the recollindex process with a SIGTERM as is suggested by the source code - it seems like from rclinit.cpp, that SIGHUP, SIGINT, SIGQUIT, SIGTERM, SIGUSR1, SIGUSR2 would all signal recollindexer to stop and shut down (at least, that’s what I would expect…) I’ve tried experimenting by running recollindex with -D to not detach from a terminal and then issue a SIGTERM from a different terminal, which has no effect, other than the recollindex process saying "Got signal, registering stop request". Yet, recollindex continues to scan and index my filesystem rather than exit.

I downloaded the source for recoll and I see where the signal handling code is being run, but I figured that I would ask here before spending x hours digging into the bowels of the recoll source code to figure out why this might be.

Of course, there’s the chance that sending SIGTERM is NOT intended to shut down the indexing and make the process exit, in which case I suppose I’ll have to force gnome to send a SIGKILL rather than a SIGTERM when it exits. If anyone knows if this is the case, please let me know and this ticket should just die.

medoc writes

Hello and thanks for looking into this. Yes, SIGTERM is supposed to end the indexing (after a delay necessary for clean shutdown, to be made as short as possible), and what you are seeing is a bug. I wonder if this might be specific to the initial run inside the real time mode (the daemon process runs a normal indexing pass before going into real-time updating).

There are quite a few problems with the current threading and interrupting code, this also manifests itself when running searches while the indexing thread is running inside the GUI process.

I intend to take a look at the issue that you are reporting, but if you beat me to it, I won’t complain !

Cheers,

jf

track16 writes

I’m going to be quite busy with other projects for the next 3-4 weeks, but after that if you haven’t gotten a chance to look at this issue, I’ll take a look then and see if I can figure it out.

Thanks for the quick response!

medoc writes

As far as I can see, the current code (commit 2251), does not exhibit the problem. I couldn’t really reproduce it with 1.15 either, so I’m not too sure I fixed it, but I did improve responsiveness to interrupts in some cases, and may be this changed how recoll will behave for you. Please test the new version when you get a moment.

I have put a snapshot of the web site to make this easier: http://www.recoll.org/betarecoll-2251.tar.gz

Also, as far as I can see, the gnome session does not send signals when exiting, and I don’t know of a way to execute a final script (symetric to the startup one). The way recollindex knows it should exit is by monitoring the state of the X11 server. But it should also respond to termination signals.

track16 writes

I tried your build 2251 and indeed, recollindex responds to SIGTERM and shuts down cleanly. Thank you!

Additionally, the session monitoring seems to be fixed as well so that recoll shuts down when gnome-session exits. Perfect!