zenoh-pico
zenoh-pico copied to clipboard
[Bug] [All platforms] Unicast lease (possibly others?) does not kill session on timeout
Describe the bug
Whenever the keepalive lease times out (for example, zenohd shut down), the session never actually gets closed. Doing z_check(session)
keeps returning true as well. The session remains active so for example a publisher will keep publishing to nothing.
To reproduce
- Open a session to zenohd
- Check if the session is up
- Close session
- z_check(session) returns true after timeout.
System info
Zenohd 0.10.1 zenoh-pico 0.10.1 esp32-eth01, esp32-lolin
Dissecting this issue further. Log states session will close: https://github.com/eclipse-zenoh/zenoh-pico/blob/main/src/transport/unicast/lease.c#L56
Then disables the lease loop. It then calls this: https://github.com/eclipse-zenoh/zenoh-pico/blob/main/src/transport/unicast/transport.c#L281
That then simply creates a close message and transmits it to the router (if it exists, generic session close command) https://github.com/eclipse-zenoh/zenoh-pico/blob/main/src/transport/unicast/transport.c#L272 But at no point does it actually close the session on its own.
Confirmed, this issue is present on all platforms.
Easy test on linux machine:
- Run
zenohd -l tcp/192.168.1.100:7447 -l udp/192.168.1.100:7447
- Build the examples of zenoh-pico
- Run `z_pub -n 999 -m client -e tcp/192.168.1.100:7447
- Wait for session to connect and begin publishing messages
- Kill the
zenohd
router -
z_pub
keeps publishing data to nothing forever
Related to #333