Closed shell-skrimp closed 1 month ago
@shell-skrimp Your example code says "fber/v3", but the errors say "fiber/v2". Which one is it?
@gaby I've updated the sample to show the bug. The bug occurs when app.Use(logger.New(logger.Config{
is enabled. If you comment out that block of code there is no bug.
@gaby I've updated the sample to show the bug. The bug occurs when
app.Use(logger.New(logger.Config{
is enabled. If you comment out that block of code there is no bug.
Does this issue still occur if you remove ${bytesSent}
from logger format?
@efectn if I set that to -
there is no bug
ok then it is related to this line https://github.com/gofiber/fiber/blob/6968d51d0dc990f60541536423cc7898b387bae4/middleware/logger/tags.go#L94
I can confirm on main program when I omit or change ${bytesSent}
to -
there is no bug; I will just do that for now.
@ReneWerner87 I believe that's the bug because it reads from the body without closing?
Close is not really needed there. Its something else We need to debug
This also happens with {bytesReceived}
tag.
@shell-skrimp Fix has been submitted for both Fiber/v2 and Fiber/v3
Unsure on the release cadence, but do you guys know when a new release will be cut with the fix?
@ReneWerner87 We may need a new v2 release to backport this.
@ReneWerner87 can we get this backported to v2? I have some services in prod where I had to do some builds with the bytesRecv/bytesSent disabled, would be nice to enable that functionality again
@shell-skrimp It's backported, we just need to do a new v2 release. It was backported in https://github.com/gofiber/fiber/pull/3067
Bug Description
When download large files the process can be OOM'd. I have tried serving ~2GB ISOs and I've noticed that memory is not reclaimed.
How to Reproduce
Steps to reproduce the behavior:
curl localhost/isos/some.iso
33MB
RSS is used. Once I've downloaded a 2GB iso, the process is now using4128M
. If I download the file again, this amount of memory increases. Eventually the process is OOM'd.Download: true
(in static) andCacheDuration: -1
pprof (if it helps):
(-inuse_space)
(-alloc_space)
Expected Behavior
File should be served without OOMing.
Fiber Version
v2.52.4
Code Snippet (optional)
Checklist: