Tanganelli / CoAPthon

CoAPthon is a python library to the CoAP protocol aligned with the RFC
MIT License
224 stars 131 forks source link

Fix message layer threading issues #151

Closed michaelmalonenz closed 1 year ago

michaelmalonenz commented 5 years ago

Occasionally, we will see a 'NoneType object has no member 'set'` directly after an if-statement checking to see that the offending object is not None. This smells of threading problems, so I've made setting the object to None (presumably encouraging the thread to be garbage collected) less agressive, and certainly not from within the function which is being run by the thread - that seems like a recipe for problems such as this.

The trade-off is that the (old) memory is cleared when a new retransmit operation is started, not after the initial retransmit has completed, but the value gained is correctness.