tecki / ebpfcat

A Python-base EBPF code generator
GNU General Public License v2.0
16 stars 5 forks source link

ebpfcat.xdp.XDP.detach never yields #13

Open ahmet-umut opened 4 months ago

ahmet-umut commented 4 months ago

xdp.XDP.detach never returns... Thus when we write await program.detach(...) we wait forever. Sending keyboard interrupt (ctrl*c) during this infinite wait results in the python program terminating, after which we see that the eBPF program has been detached. So the function actually does its job, but it has to be awaited. Otherwise it does not detach the program from XDP. I worked around that by asyncio.wait_for(program.detach(...), 1) where 1 is the timeout threshold in seconds.