Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Close ijson coroutines ourselves instead of letting the GC close them #13293

Closed
@squahtx

Description

@squahtx

def finish(self) -> SendJoinResponse:
for c in self._coros:
c.close()

def finish(self) -> StateRequestResponse:
for c in self._coros:
c.close()

These close() calls were added in #12875, but I overlooked that we'd only close the first coroutine if it raised an IncompleteJSONError.
We need to close all coroutines, even when any of them raise an error.

Until we fix this properly, we'll get unhelpful Exception ignored in: <generator object utf8_encoder at 0x7f87c9b1ccf0> errors in sentry without a stack trace or logging context.

Metadata

Metadata

Assignees

Labels

A-FederationS-TolerableMinor significance, cosmetic issues, low or no impact to users.T-DefectBugs, crashes, hangs, security vulnerabilities, or other reported issues.Z-SentryIssue was discovered by looking at Sentry reports on Matrix.orggood first issueGood for newcomers

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions