Skip to content

cant print debug stack using middleware Recover() and Timeout() #2634

Open
@gitouyoung

Description

@gitouyoung

This is my middlewares:

middleware.Recover(),
middleware.TimeoutWithConfig(middleware.TimeoutConfig{
	Skipper: func(c echo.Context) bool {
		return strings.HasPrefix(c.Request().RequestURI, "/debug/pprof/")
	},
	ErrorMessage: "timeout",
	Timeout:      10 * time.Second,
}),

after I add timeout middleware, log cannot show where panic occurs, the stack output always be like :
image

If I remove timeout middleware, log shows where panic occurs. the stack output is:
image

I wonder how can Recover() print panic stack correctly while using both Recover() and Timeout()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions