Re: [gamin] gamin abstract socket bind() probem



On Tue, Aug 03, 2004 at 08:19:00AM -0400, John McCutchan wrote:
> On Tue, 2004-08-03 at 03:21, Daniel Veillard wrote:
> >   Strange, this might be due to threading, because otherwise the socket
> > creation is a system call and atomicity of the operation is garanteed
> > by the kernel. I didn't yet tried to debug the gamin problem with 
> > gnome-session, I will try today. Did you use gamin CVS checkout ? I fixed
> > a couple or bugs yesterday.
> 
> 
> I don't think I am using threading. What happens is gnome-session starts
> up a bunch of apps all at the same time. So each app that needs fam,
> starts up the gam_server. After this it's a race for the multiple
> instances of gam_server to get the abstract socket first. whichever
> instance gets the socket succeeds and the other instances fail (Which
> then causes gnome-settings-daemon to crash).

  I have been looking at this (starting gnome-session in an xterm + twm
environemnt has some fun :-), we cannot avoid the race, this would require
to make some locking (and I don't want to rely on this unless I really 
don't have any other way). There is really no hard constraint in all that
code and the kernel garantees there is only one server running (per user/
session id), and even that could be relaxed without semantic breakage.
  The related code is in gamin_connect_unix_socket() in gam_api.c
even if another process concurrently forked a gam_server between the time
of the connect() and when it actually started this should not fail. Somehow
I rather think it's the timeout which is too low, I'm gonna increase the
value and change the retry code to always retry from the start by closing the
fd and reinitializing the socket, just in case.

Daniel

-- 
Daniel Veillard      | Red Hat Desktop team http://redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]