Skip to content

today hasn’t exactly been going well

11 April 2006

Is it really true that apps can’t gracefully recover from losing their connection to the X server? The XSetIOErrorHandler() man page says:

The XSetIOErrorHandler sets the fatal I/O error handler. Xlib calls the program’s supplied error handler if any sort of system call error occurs (for example, the connection to the server was lost). This is assumed to be a fatal condition, and the called routine should not return. If the I/O error handler does return, the client process exits.

This sucks! The Beagle daemon doesn’t require X, but if it’s available it listens to the screensaver extension to see whether or not the session is idle and speeds up indexing if it is. But if the X connection is at any point lost, the daemon exits *immediately*. This doesn’t give us a chance to gracefully shut down, and there doesn’t appear to be anything we can do about it, short of moving this screensaver code out of process. (Which would be a real pain, and slow down indexing in general.)

Anyone have any suggestions?

2 Trackbacks/Pingbacks

  1. joe shaw on 12 April 2006 at 11:06 am

    [...] Ok, a follow-up to my Xlib post from yesterday. [...]

  2. joe shaw on 20 April 2006 at 12:37 pm

    [...] Beagle 0.2.5 is out! This version fixes two big problems were seeing with 0.2.4: first, that it wouldn’t compile with Mono 1.1.14 and second, that web pages viewed with the Firefox extension couldn’t be searched. Also, there are a bunch of other bug fixes in there. 0.2.5 also has a fix for the X connection issues I mentioned previously. [...]