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

update #1

Merged
merged 15 commits into from
Sep 11, 2021
Merged

update #1

merged 15 commits into from
Sep 11, 2021

Conversation

chhquan
Copy link
Owner

@chhquan chhquan commented Sep 11, 2021

update

lancoLiu and others added 15 commits August 23, 2021 11:27
Github workers on windows are slow.
Ensure `len(b)` <= `cap(b)` at all times. Additionally, use `runtime.KeepAlive()` to prevent `s` from being GC-ed.
* Fix various Windows Github Action errors

These tests keep giving errors because Windows Actions are slower.

* Remove some timeouts

We don't need timeouts in all tests, only in the ones where we are
actually testing timeout logic.
The return value of normalizePath should be a reusable []byte.
Returning strSlash could cause the strSlash constant to be reused and
resulted in very weird behavior. This specific case of normalizePath
almost never happens which made it even harder to spot.

The race detector on Windows was the only clue that something was
happening:

WARNING: DATA RACE
Write at 0x000001d082e3 by goroutine 446:
  github.com/valyala/fasthttp.addLeadingSlash()
      D:/a/fasthttp/fasthttp/uri_windows.go:8 +0xa5
  github.com/valyala/fasthttp.normalizePath()
      D:/a/fasthttp/fasthttp/uri.go:343 +0xbd
  github.com/valyala/fasthttp.(*URI).parse()
      D:/a/fasthttp/fasthttp/uri.go:314 +0x1606
  github.com/valyala/fasthttp.(*URI).Parse()
      D:/a/fasthttp/fasthttp/uri.go:266 +0xb3
  github.com/valyala/fasthttp.testURIPathNormalize()
      D:/a/fasthttp/fasthttp/uri_test.go:195 +0x47
  github.com/valyala/fasthttp.TestURIPathNormalize()
      D:/a/fasthttp/fasthttp/uri_test.go:176 +0x38e
  testing.tRunner()
      C:/hostedtoolcache/windows/go/1.15.15/x64/src/testing/testing.go:1123 +0x202

Previous read at 0x000001d082e3 by goroutine 332:
  runtime.slicecopy()
      C:/hostedtoolcache/windows/go/1.15.15/x64/src/runtime/slice.go:246 +0x0
  github.com/valyala/fasthttp.(*RequestHeader).AppendBytes()
      D:/a/fasthttp/fasthttp/header.go:1726 +0x24d
  github.com/valyala/fasthttp.(*RequestHeader).Header()
      D:/a/fasthttp/fasthttp/header.go:1698 +0x84
  github.com/valyala/fasthttp.(*RequestHeader).Write()
      D:/a/fasthttp/fasthttp/header.go:1682 +0x10f
  github.com/valyala/fasthttp.(*Request).Write()
      D:/a/fasthttp/fasthttp/http.go:1370 +0x1ab
  github.com/valyala/fasthttp.testRequestSuccess()
      D:/a/fasthttp/fasthttp/http_test.go:1788 +0x32a
  github.com/valyala/fasthttp.TestRequestSuccess()
      D:/a/fasthttp/fasthttp/http_test.go:1678 +0x2dd
  testing.tRunner()
      C:/hostedtoolcache/windows/go/1.15.15/x64/src/testing/testing.go:1123 +0x202
* improve invalidStatusLine

* append []byte directly

* AppendUint

* negetive

* AppendInt
These tests all try to create the compressed versions of files at the
same time which might lead to concurrency errors.
* feat: improve bytesEqual

* benchmark

* nolint:unused

* remove unused  code

* Update client.go

Co-authored-by: Erik Dubbelboer <erik@dubbelboer.com>

Co-authored-by: Erik Dubbelboer <erik@dubbelboer.com>
* Adding "image/svg" as compressible prefix

* Adding additional compressible prefixes from https://support.cloudflare.com/hc/en-us/articles/200168396-What-will-Cloudflare-compress-
@chhquan chhquan merged commit 1d670c3 into chhquan:master Sep 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants