Closed mikenerone closed 3 years ago
Umm, this particular error does get caught:
async def close(self):
try:
await self._stream.close()
except AttributeError:
await self._stream.aclose()
Could you replace the code in distmqtt/adapters,py
with
async def close(self):
try:
await self._stream.aclose()
except anyio.BrokenResourceError:
pass
and check whether anything else breaks?
nm, this was my bad. I missed that there was a new release with this fixed.
Stack trace says it all. Note that this is during a (trio) cancellation of the scope in which the client is running - i.e. I am intentionally shutting down this client, but not the whole app (oddly, I don't see this error when shutting down the whole app).
That
self._stream
is ananyio.streams.tls.TLSStream
object. Since anyio 2.0.0,close()
is renamed toaclose()
. It seems likely that other updates are needed, as well (bunch of renames/deprecations at https://anyio.readthedocs.io/en/latest/versionhistory.html), but I'm just reporting the specific issue I hit.