Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement udev queue API #66

Closed
socketpair opened this issue May 18, 2013 · 3 comments
Closed

Implement udev queue API #66

socketpair opened this issue May 18, 2013 · 3 comments

Comments

@socketpair
Copy link

If I use udev monitoring for events, suppose I monitor event 'add'. I use
pyudev.Monitor.from_netlink(context, 'udev')

So, When event occur, I want to look to only .is_initialized devices. In my udev (Ubuntu 12.04) all network devices are NOT is_initialized if checked right in event. Even more, if I perform this:

print device.is_initialized
sleep(5)
print device.is_initialized

I will see that device still not .is_initialized (strace show that no socket syscalls called during this sequence). So, if I perform:

print device.is_initialized
sleep(5)
print Device.from_path(self.context, device.device_path).is_initialized

In this case, will print False and later True, and I am done!. But using blocking sleep with hardcoded value got from sky + call expensive udev function.

So, We need some way to determine when udev event complete before getting device again. AFAIK, udev has no API for monitoring initialization process.

In one hand we have device.sequence_number and udev_queue_get_seqnum_is_finished in other. So, why not to give API to allow polling of udev using udev_queue_get_seqnum_is_finished if udev does not support event-based notification of event completion.

@socketpair
Copy link
Author

I looked at udev sources, and saw that it work like:

  1. receive netlink message from kernel
  2. process queue, writing some info into its DB.
  3. notify userspace programs passing original device (without info from DB)

Therefore, I should re-request device from udev DB. So, queue API is not required for me, but it must be done to make python-udev binding complete .

@socketpair
Copy link
Author

Is bug fixed?

@mulkieran
Copy link
Contributor

No. See Changelog from new release for changes (https://github.com/pyudev/pyudev/blob/master/CHANGES.rst). python-pyudev has been mostly inactive since you filed this issue. The changes include what looks like completed development from the develop branch, a bunch of housekeeping fixes, and a few bug fixes. There's unlikely to be much progress on this issue unless you open a PR yourself, as this would certainly constitute new development.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants