Re: g_idle killer ...



Hi Owen,

On 17 Jul 2000, Owen Taylor wrote:
> Using an idle handlers for this seems bizarre. If nothing else
> is going on in the client process, then I bet the server will
> never successfully register before being killed.
> 
>  idle == timeout of zero with a low priority compared to
>          other events in the process.

	Yes; I think I am aware of this. However, for some reason ( which
may be an anachronism ), and quite why eludes me, some programs complete
their initialization in a 1 shot idle handler. This was my way to avoid
a timeout clobbering that, however, perhaps if you register your factory
in an idle handler you have it coming anyway.

> Could be that something isn't properly taking a zero length read
> to indicate a closed socket.

	Quite possibly; I wouldn't know but I imagine oaf-registration.c
(handle_exe_pipe): 

	if (!(condition & G_IO_IN)
	    || !fgets (data->iorbuf, sizeof (data->iorbuf), data->fh))
		retval = FALSE;

	deals with that in the fgets; but I know not whether this is in
fact the problem.

> > +                        g_error ("This process has not registered the required OafIID\n"
> 
> Does this represent a bug in the client? Do you want people to report
> a bug against the client to bugs.gnome.org with a backtrace at this
> point? Is it worth dumping core? If not, don't use g_error()...

	It is a fatal error to claim you register a factory and then not
register it yes. Perhaps it would be better to have a g_warning and an
exit, but either way it is a serious bug in the client and it needs
fixing, as for a backtrace, that is less useful. The reason for the
g_error was rather a convenience for me in that a death allows oafd 
to return the exception nicely to the oafd client with no further effort.

> Maciej writes:
> I disagree with doing this in an idle handler, that whole approach is
> bogus. Number of times in the idle handler is a bad way to measure
> reasonable startup time. Consider objects activated over the network
> for instance.

	Yes, they are both arbitary; I suppose a timeout might be better,
both are rather feeble, I'm running out of better suggestions though,
apart from publicising oaf_postinit and doing it there, which mostly
sucks.

	Regards,

		Michael.

-- 
 mmeeks@gnu.org  <><, Pseudo Engineer, itinerant idiot






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