Fix python map.items() racing with bpf delete
authorBrenden Blanco <bblanco@plumgrid.com>
Sun, 7 Feb 2016 14:57:17 +0000 (06:57 -0800)
committerBrenden Blanco <bblanco@plumgrid.com>
Sun, 7 Feb 2016 14:57:17 +0000 (06:57 -0800)
commitefbc28c993b24b81efdb78c29e6ad499d18218d8
tree54e02d9ff0d66d8f7ad69bd2e9bc15541de797e0
parentd366b0e0c789bf622bf78539ef2df6d198ec7775
Fix python map.items() racing with bpf delete

The default python implementation of itervalues(), iteritems(), items(), and
values() do a sequence of iter().next followed by self[key], which may
produce a KeyError since a bpf program can delete them quickly. It
should be safe to suppress such errors, hiding them from the user.

Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
src/python/bcc/__init__.py