Every so often, if I touch a dot-file in a dir beacon is monitoring, I get a KeyError:

ERROR nf_generic(156): removed timer 36
Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/kaa/notifier/nf_generic.py", line 147, in step
    if not callback():
  File "/usr/lib/python2.4/site-packages/kaa/notifier/timer.py", line 87, in __call__
    return super(Timer, self).__call__(*args, **kwargs)
  File "/usr/lib/python2.4/site-packages/kaa/notifier/callback.py", line 245, in __call__
    ret = super(NotifierCallback, self).__call__(*args, **kwargs)
  File "/usr/lib/python2.4/site-packages/kaa/notifier/callback.py", line 191, in __call__
    result = cb(*cb_args, **cb_kwargs)
  File "/usr/lib/python2.4/site-packages/kaa/beacon/crawl.py", line 408, in check_mtime_step
    if item._beacon_changed():
  File "/usr/lib/python2.4/site-packages/kaa/beacon/item.py", line 100, in _beacon_changed
    return self._beacon_mtime() != self._beacon_data['mtime']
  File "/usr/lib/python2.4/site-packages/kaa/beacon/file.py", line 111, in _beacon_mtime
    mtime = listdir_file_map[fullname][3][stat.ST_MTIME]
KeyError: '.foop'

Looks like the File is getting added due to the inotify event, but because it's a hidden file _beacon_listdir() doesn't include it.

Tempting to add a "if fullname not in listdir_file_map: return 0" to _check_mtime() but that's just hiding the bug.  dischi, maybe you have a better idea how to fix this than I do. :)

Reply via email to