Opened 11 years ago

Last modified 10 years ago

#5068 defect new

Inotify does not pass the cookie to event callbacks

Reported by: Christopher Rosell Owned by:
Priority: normal Milestone:
Component: core Keywords:
Cc: Branch:


Currently there is no way to access the cookie that is passed to the IN_MOVE_FROM and IN_MOVE_TO events. This cookie is required to maintain a connection between the two events. I've attached a patch that adds the cookie to the callback arguments.

Attachments (1)

twisted_internet_inotify-add_cookie_to_callbacks.diff (3.6 KB) - added by Christopher Rosell 11 years ago.

Download all attachments as: .zip

Change History (3)

Changed 11 years ago by Christopher Rosell

comment:1 Changed 10 years ago by Sergey

Yeah, this bug affects mee to. There is no way to track file movements now.

comment:2 Changed 10 years ago by Jean-Paul Calderone

This looks like an important issue to fix. I'm not sure why the cookie wasn't exposed originally.

Please take a look at ReviewProcess to details about the workflow; in particular, be sure to add "review" to the keywords of a ticket that has an implementation of the proposed change attached, otherwise there's very little chance anyone will look at the ticket in a timely manner.

As far as the patch attached to this ticket goes, there are a couple problems:

  1. The change is not backwards compatible. Existing users of the inotify API will be broken, because their callbacks will not accept the cookie argument. This is visible in the changes to the unit tests that come with this patch - the tests are broken unless they get updated. Instead, we should introduce a new API for registering callbacks that get the cookie. All the existing unit tests should continue to pass unmodified, and the new API should have new unit tests that exercise the cookie cases.
  2. The change needs to be documented.

Please be sure to attach the "review" keyword once there's a patch that addresses these points! Thanks.

Note: See TracTickets for help on using tickets.