Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚀 [Feature]: Allow to stop the timestamp updater #69

Open
3 tasks done
leonklingele opened this issue Feb 23, 2024 · 4 comments
Open
3 tasks done

🚀 [Feature]: Allow to stop the timestamp updater #69

leonklingele opened this issue Feb 23, 2024 · 4 comments

Comments

@leonklingele
Copy link
Member

Feature Description

There should be a way to stop the timestamp updater again so we don't leak a goroutine.

When using Uber's goleak you have to manually ignore these after shutting down the fiber server:

package handlers_test

import (
	"testing"

	"go.uber.org/goleak"
)

func TestMain(m *testing.M) {
	goleak.VerifyTestMain(
		m,
		// TODO: Fix those leaks upstream
		goleak.IgnoreTopFunction("time.Sleep"), // https://github.com/valyala/fasthttp/blob/0be5a4150cb0e35605cffd09e922707355dbdec3/fs.go#L477-L480
		goleak.IgnoreTopFunction("github.com/gofiber/fiber/v2/internal/memory.(*Storage).gc"),
		goleak.IgnoreTopFunction("github.com/gofiber/fiber/v2/internal/storage/memory.(*Storage).gc"),
		goleak.IgnoreTopFunction("github.com/gofiber/fiber/v2/internal/storage/memory.New.StartTimeStampUpdater.func1.1"),
		goleak.IgnoreTopFunction("github.com/gofiber/fiber/v2/utils.StartTimeStampUpdater.func1.1"),
	)
}

Additional Context (optional)

No response

Code Snippet (optional)

No response

Checklist:

  • I agree to follow Fiber's Code of Conduct.
  • I have checked for existing issues that describe my suggestion prior to opening this one.
  • I understand that improperly formatted feature requests may be closed without explanation.
@ReneWerner87
Copy link
Member

this concept was copied from fasthttp and is supposed to bring performance
what is the alternative without the loss of performance ?

@leonklingele
Copy link
Member Author

leonklingele commented Feb 23, 2024 via email

@nickajacks1
Copy link
Member

this concept was copied from fasthttp and is supposed to bring performance what is the alternative without the loss of performance ?

This isnt proposing to get rid of the timer, just adding the ability to shut it down manually.

@ReneWerner87
Copy link
Member

Ok, sorry misunderstanding
Then sure we could do it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants