labthings / labthings/labthings-fastapi
LogRecord objects can interfere with garbage collection and cause internal server errors.
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 9
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Description
LogRecord objects can hold arbitrary arguments - we should probably call getMessage() in our custom handler and store only the string, rather than hanging on to the LogRecord object. This will also simplify serialising the logs later, because getMessage() can raise exceptions, so it should be called when the log is handled, not when the list of logs is serialised.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the custom log handler and the code that stores and serialises its logs. Trace when LogRecord objects are retained and when getMessage() is called; done means the handler stores only the resulting string and later serialisation no longer retains LogRecord arguments or triggers the described errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- fastapi, python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100