You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I created a dummy function, that just offers a 10GB file as download and send it the stop signal (CRTL + C) after starting the download.
Even though I started the server with ShutdownTimeout=10 * time.Second and stopped him with app.ShutdownWithTimeout(10 * time.Second) the app shut down immediately and did not wait the configured time.
// Pfad zur großen DateiconstlargeFilePath="/tmp/large_files/large_file.bin"// HandleLargeFileStream streamt eine echte 10GB Datei// Dies hält die Verbindung für eine längere Zeit offen, abhängig von der DownloadgeschwindigkeitfuncHandleLargeFileStream(c fiber.Ctx) error {
// Datei öffnenfile, err:=os.Open(largeFilePath)
iferr!=nil {
returnc.Status(fiber.StatusInternalServerError).SendString(fmt.Sprintf("Fehler beim Öffnen der Datei: %v", err))
}
deferfile.Close()
// Dateigröße ermittelnfileInfo, err:=file.Stat()
iferr!=nil {
returnc.Status(fiber.StatusInternalServerError).SendString(fmt.Sprintf("Fehler beim Abrufen der Dateigröße: %v", err))
}
fileSize:=fileInfo.Size()
// Header setzenc.Set("Content-Type", "application/octet-stream")
c.Set("Content-Disposition", "attachment; filename=\"large_file.bin\"")
c.Set("Content-Length", fmt.Sprintf("%d", fileSize))
c.SendFile(largeFilePath)
returnnil
}
// Set up graceful shutdownc:=make(chan os.Signal, 1)
signal.Notify(c, os.Interrupt, syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM)
gofunc() {
<-c_=app.ShutdownWithTimeout(cfg.Server.ShutdownTimeout)
}()
Expected Behavior
I was expecting it to close all listeners but to respect ALL currently active connections (untill the timeout). But this did not happen, the app shut down immediately.
Bug Description
I created a dummy function, that just offers a 10GB file as download and send it the stop signal (
CRTL + C
) after starting the download.Even though I started the server with
ShutdownTimeout=10 * time.Second
and stopped him withapp.ShutdownWithTimeout(10 * time.Second)
the app shut down immediately and did not wait the configured time.How to Reproduce
dd if=/dev/urandom of=/tmp/large_files/large_file.bin bs=1M count=10240 status=progress
CONFIG
Set up this Signal-Trap:
Expected Behavior
I was expecting it to close all listeners but to respect ALL currently active connections (untill the timeout). But this did not happen, the app shut down immediately.
Fiber Version
v3.0.0-beta.4
Checklist:
The text was updated successfully, but these errors were encountered: