Skip to content

traceroute needs graceful recovery from error #762

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
roberthadow opened this issue Apr 15, 2025 · 1 comment
Open

traceroute needs graceful recovery from error #762

roberthadow opened this issue Apr 15, 2025 · 1 comment

Comments

@roberthadow
Copy link

When traceroute fails, it fails catastrophically. It needs to be refactored to exit gracefully rather than hanging the system.

For testing pruposes, I have a bash script on my Ubuntu system with lines like this:

meshtastic --host 192.168.1.202 --traceroute '!b03dbb38'

When the command fails, it hangs in the terminal, typically something like this:

Exception in thread Thread-19:
Traceback (most recent call last):
  File "/home/rhadow/miniconda3/lib/python3.12/threading.py", line 1073, in _bootstrap_inner
    self.run()
  File "/home/rhadow/miniconda3/lib/python3.12/threading.py", line 1431, in run
    self.function(*self.args, **self.kwargs)
  File "/home/rhadow/miniconda3/lib/python3.12/site-packages/meshtastic/mesh_interface.py", line 1116, in callback
    self.sendHeartbeat()
  File "/home/rhadow/miniconda3/lib/python3.12/site-packages/meshtastic/mesh_interface.py", line 1105, in sendHeartbeat
    self._sendToRadio(p)
  File "/home/rhadow/miniconda3/lib/python3.12/site-packages/meshtastic/mesh_interface.py", line 1180, in _sendToRadio
    self._sendToRadioImpl(toRadio)
  File "/home/rhadow/miniconda3/lib/python3.12/site-packages/meshtastic/stream_interface.py", line 120, in _sendToRadioImpl
    self._writeBytes(header + b)
  File "/home/rhadow/miniconda3/lib/python3.12/site-packages/meshtastic/tcp_interface.py", line 79, in _writeBytes
    self.socket.send(b)

...
It may generate a couple more threads, then just stop with

BrokenPipeError: [Errno 32] Broken pipe

Instead of returning control to the bash script, it just hangs.

It needs to detect the error, grafeully exit with notification, then allow the bash script to continue.

@roberthadow
Copy link
Author

roberthadow commented Apr 19, 2025

This issue duplicates #765.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant