Summary: | Invalid handling of hotplug events coming in wrong order | ||
---|---|---|---|
Product: | hal | Reporter: | Alexander Darovsky <adarovsky> |
Component: | hald | Assignee: | David Zeuthen (not reading bugmail) <zeuthen> |
Status: | RESOLVED NOTABUG | QA Contact: | |
Severity: | major | ||
Priority: | high | ||
Version: | unspecified | ||
Hardware: | Other | ||
OS: | Linux (All) | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: | a possible fix |
Description
Alexander Darovsky
2005-12-08 18:40:37 UTC
Created attachment 4063 [details] [review] a possible fix This is a possible fix. It isn't the most elegant of solutions, but it is effective and rather non-intrusive: hal.hotplug attaches a POSIX shared memory segment containing the last processed seqnum, forks into the background and waits until the last processed seqnum is seqnum-1, or until .5 seconds elapse (which never happens on my system, it's just a safeguard because I don't know hotplug too well). There is the remote chance of a race condition because storing a new value in the shared memory segment is probably not atomic (I don't know if it is), but if this kind of perfection is worth the added complexity of mutex-protected access is up to you ;) The hal hotplug helper is obsolete with the next release. udev use now a direct socket to HAL. Could you try to reproduce this with the newest udev version. For more see the CVS comment: 2005-11-15 Kay Sievers <kay.sievers@vrfy.org> * hald/linux2/osspec.c: (hald_udev_data), (hald_helper_data), (osspec_init): Listen to socket: /org/freedesktop/hal/udev_event Udev will pass all data over this socket to HAL, if the following rule is given: RUN+="socket:/org/freedesktop/hal/udev_event" The HAL hotplug helper /usr/sbin/hal.hotplug is no longer needed and should be replaced by the direct udev connection which will no longer fork a process for every event. This is the preparation to reuse the persistent data udev collects from the hardware, instead of querying it a second time with HAL. If we reach this, drive_id/* and the hotplug helper will be removed from HAL. HAL depends on udev to receice kernel events, no other solution is supported or expected to work reliably. HAL intentionally does not care about SEQNUM. Udev does that, or recent kernel/udev setups receive kernel events from a socket instead of using /sbin/hotplug and SEQNUM. (In reply to comment #2) > The hal hotplug helper is obsolete with the next release. udev use now a direct > socket to HAL. Could you try to reproduce this with the newest udev version. > For more see the CVS comment: > > 2005-11-15 Kay Sievers <kay.sievers@vrfy.org> > > * hald/linux2/osspec.c: (hald_udev_data), (hald_helper_data), > (osspec_init): Listen to socket: /org/freedesktop/hal/udev_event > Udev will pass all data over this socket to HAL, if the following > rule is given: > RUN+="socket:/org/freedesktop/hal/udev_event" > > The HAL hotplug helper /usr/sbin/hal.hotplug is no longer needed > and should be replaced by the direct udev connection which will > no longer fork a process for every event. > > This is the preparation to reuse the persistent data udev collects > from the hardware, instead of querying it a second time with HAL. > If we reach this, drive_id/* and the hotplug helper will be removed > from HAL. > Thank you. The problem was really in udev. I couldn't imagine that it can make mess from hotplug events, but udev-073 did. Upgrade to 077 or downgrade to 072 solves this problem |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.