New watch notifies about events of a removed watch

Bug #1006594 reported by Philipp Neubeck
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
inotify-java
New
Undecided
Unassigned

Bug Description

Given a watch A with watchid 1.
Remove this watch and register a new watch B for the same file.

Queued events of watch A are not deleted.
The new watch may obtain the same watchid 1.
The queued events are fired for watch B, although they occured before B was registered.

In my opinion, this is a severe bug as it can produce arbitrary events because of reused watchids.

Possible fix:
Remove all queued events of a watch if this watch is removed.
Be careful that LinkedBlockingQueue does not support a blocking removeAll. Instead another Queue implementation or some additional locking has to be used.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.