Ian McEwen
ce5bbcda68
Fix some leaks/hangs on close: unstarted StreamInterface streams & TCP reader unblock
2026-05-31 13:48:06 -07:00
Ian McEwen
14f53398d7
Merge commit 'refs/pull/857/head' of github.com:meshtastic/python into tmp/merge-918-857
2026-05-31 12:52:02 -07:00
nightjoker7
bfe38ac0c7
StreamInterface: prevent socket/reader-thread leak on handshake failure in __init__
...
If connect() or waitForConfig() raises during __init__ (handshake timeout,
bad stream, config error), the reader thread started by connect() keeps
running and the underlying stream/socket stays open — but the caller never
receives a reference to the half-initialized instance, so they cannot call
close() themselves. The leak compounds on every retry from a caller's
reconnect loop.
Fix: wrap connect() + waitForConfig() in try/except; call self.close() on
any exception before re-raising. Also guard close() against RuntimeError
from joining an unstarted reader thread (happens when close() runs from
a failed __init__ before connect() could spawn it).
Discovered while debugging a real-world Meshtastic firmware crash where
a passive logger's retrying TCPInterface() calls against a node with
250-entry NodeDB produced a reconnect storm — every retry triggered a
full config+NodeDB dump on the node, compounding heap pressure, which
then exposed null-deref bugs in Router::perhapsDecode / MeshService
(firmware side fixed in meshtastic/firmware#10226 and #10229 ). The
client-side leak is independent of those firmware bugs and worth fixing
on its own.
2026-04-25 15:02:38 -05:00
Ian McEwen
096fec95c8
Revert "Wrap double-close in a try-catch. Slightly ugly but oh well."
...
This reverts commit dbc0101a7a .
2025-11-13 12:07:48 -07:00
Ian McEwen
dea5f788a2
Revert "Add more exception logging, fix some additional stream read/write issues"
...
This reverts commit f15a0bdc0b .
2025-11-13 12:07:32 -07:00
Ian McEwen
f15a0bdc0b
Add more exception logging, fix some additional stream read/write issues
2025-11-13 11:38:00 -07:00
Travis-L-R
1214d5010b
Linting adjustment for change to StreamInterface non-abstract use check
2025-11-13 07:38:25 +10:30
Travis-L-R
3be73b42e2
Removing unnecessary initialization of self.stream in TCPInterface
2025-11-11 19:19:44 +10:30
Travis-L-R
79334e83e6
Adjusting old deprecation test and exception for non-abstract use of StreamInterface
2025-11-11 18:57:52 +10:30
Ian McEwen
dbc0101a7a
Wrap double-close in a try-catch. Slightly ugly but oh well.
2025-11-10 13:58:12 -07:00
horrible-knots
2de7c30a27
Plumb timeout from --timeout through MeshInterface
...
Fix C0301: Line too long
Ignore the pylint for 6 positional arguments
2025-10-13 17:35:30 -04:00
shukari
db1891b651
Added Logging Handler Names
2025-08-06 18:21:32 +02:00
Ian McEwen
384063db19
Fix some remaining mypy complaints
2024-10-29 06:47:16 -07:00
William Stearns
0da405168f
pylint cleanups
2024-10-10 23:49:20 -04:00
William Stearns
f77e788aa8
fix missing import
2024-10-10 16:33:07 -04:00
William Stearns
aba381fb54
Merge branch 'master' into wls_add_types
2024-10-08 23:28:25 -04:00
Kevin Hester
c6561713db
don't let daemon keep process alive
2024-06-25 10:27:36 -07:00
Kevin Hester
7b18fd599c
remove observable - switch because we are already using pubsub elsewhere
2024-06-25 10:25:58 -07:00
Kevin Hester
b41cb7d8df
Merge branch 'pr-poetry' into powermon
2024-06-22 10:49:42 -07:00
William Stearns
a29ee840f2
Adding mypy typing
2024-06-15 23:22:43 -04:00
Ian McEwen
e6d61c6603
Allow a faster nodedb-less startup on 2.3.11+ with --no-nodes and the magic value from meshtastic/firmware#3949
2024-06-05 18:52:35 -07:00
Ian McEwen
4baef92523
Fix assorted mypy-detected errors
2024-03-29 18:38:25 -07:00
Ian McEwen
b8640666d7
Fix some outstanding pylint issues (or disable the checks)
2024-03-19 12:47:08 -07:00
luzpaz
0a88ca6a5c
Fix various source comment typos
...
Found via `codespell -q 3`
2023-07-15 01:04:47 +00:00
Thomas Göttgens
7e6f13f0a2
establish trunk format
2023-03-31 20:09:59 +02:00
Mike Kinney
5bfebbe436
comment out code until it does not complain
2022-06-16 22:38:23 -07:00
Mike Kinney
26f65c4fee
only delay on win11
2022-02-18 10:08:53 -08:00
Mike Kinney
36c5fc8d3c
increase sleep for win11
2022-02-12 21:16:11 -08:00
Mike Kinney
ad8f2222db
cover a few more lines
2022-01-12 16:50:29 -08:00
Mike Kinney
5c662822b9
need to fully qualify imports so projects consuming the library will work
2022-01-05 11:16:08 -08:00
Mike Kinney
177705aeff
revert the stream interface change; fix tunnel tests
2021-12-31 08:49:13 -08:00
Mike Kinney
d366e74e86
refactor of Tunnel() for unit testing; create unit tests for Tunnel()
2021-12-30 21:24:32 -08:00
Mike Kinney
c70d36d2cd
revamp the serial connection to avoid Tbeam reboots
2021-12-29 19:24:26 -08:00
Mike Kinney
580c081303
captured packets and simulate what server would send
2021-12-25 16:19:13 -08:00
Mike Kinney
a243fab9af
figured out how to unit test __reader()
2021-12-25 11:39:04 -08:00
Mike Kinney
2fcfdeb04f
minor formatting; added unit tests for Node()
2021-12-16 09:10:45 -08:00
Mike Kinney
624c933dbf
fix (or disable) pylint warnings
2021-12-08 15:00:57 -08:00
Mike Kinney
6d2a187d38
fix pylint warnings
2021-12-06 23:01:34 -08:00
Mike Kinney
6b66ce97c5
revert a recent change
2021-12-06 22:40:19 -08:00
Mike Kinney
b40eb08c5c
refactor classes into respective files
2021-12-06 22:19:26 -08:00