Memory Leak caused by unique Winston categories
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript, nodejs
- Domain
- backend
Research direction
Start with src/authentication/logging/Logger.js at line 26 and reproduce the category loop or repeated endpoint calls described in the issue. Trace how Winston loggers are created and retained, then verify that repeated calls no longer cause unbounded logger accumulation.
Written by the indexing model from the issue text.
Description
When calling winston.loggers.get("category1"), if a logger with the category of "category1" is not found, it will automatically be created.
This means if we run the following code we will create 1000 separate Winston loggers.
for (let i = 0; i < 1000; i++) {
winston.loggers.get("category" + i);
}
Similarly, when any endpoint is called, the following code is run, resulting in a new Winston logger being created. https://github.com/CyberSource/cybersource-rest-client-node/blob/31baaba047b3efe62e418bd11680599a138644da/src/authentication/logging/Logger.js#L26
To my knowledge, this logger is never closed, and so new Winston loggers pile up on the heap.
- Dominant language
- JavaScript
- Stars
- 50
- Forks
- 50
- Avg merge
- 19m
- Merged PRs (30d)
- 1
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
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.
More from CyberSource/cybersource-rest-client-node
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative insteadOpen
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 52/100
CyberSource/cybersource-rest-client-node#173 · 1 reaction ·
-
Difficulty 3/5 Half a day Newbie friendliness 35/100
CyberSource/cybersource-rest-client-node#148 · 2 comments ·
All issues in CyberSource/cybersource-rest-client-node
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
Maintainers usually reply within 1 day
-
Design only Leadership Survey SLFS
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
bcgov/digital-journeys#2293 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
tursodatabase/turso#9405 ·
Maintainers usually reply within 1 day
-
Toolkit
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
API Bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ProjectSidewalk/SidewalkWebpage#5556 ·
Maintainers usually reply within 1 day