Skip to content

Context is canceled on a newly initialized fasthttp.RequestCtx in 1.56.0 #1879

Closed
@oschwald

Description

Given the following code, a "context canceled" error is printed out in 1.56.0 but not 1.55.0.

package main

import (
	"fmt"

	"github.com/valyala/fasthttp"
)

func main() {
	var r fasthttp.Request

	r.Header.SetMethod("GET")
	r.SetRequestURI("http://example/")

	var requestCtx fasthttp.RequestCtx
	requestCtx.Init(&r, nil, nil)
	fmt.Println(requestCtx.Err())
}

I was able to bisect this to a7d488a.

We use code similar to this in our tests to create a fasthttp.RequestCtx to pass to the handler. This code has been working unchanged for many years.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions