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

Data race issues are often found in pgstore.(*PGStore).MaxAge() #40

Open
abekoh opened this issue Mar 13, 2024 · 0 comments · May be fixed by #41
Open

Data race issues are often found in pgstore.(*PGStore).MaxAge() #40

abekoh opened this issue Mar 13, 2024 · 0 comments · May be fixed by #41

Comments

@abekoh
Copy link

abekoh commented Mar 13, 2024

Data race issues are often found in pgstore.(*PGStore).MaxAge(), in our application when run with the -race flag.

==================
WARNING: DATA RACE
Write at 0x00c000bb0950 by goroutine 64:
  github.com/gorilla/securecookie.(*SecureCookie).MaxAge()
      /Users/kotaro_abe/pkg/mod/github.com/gorilla/securecookie@v1.1.2/securecookie.go:203 +0x51c
  github.com/antonlindstrom/pgstore.(*PGStore).MaxAge()
      /Users/kotaro_abe/pkg/mod/github.com/antonlindstrom/pgstore@v0.0.0-20170604072116-a407030ba6d0/pgstore.go:164 +0x52c
  github.com/antonlindstrom/pgstore.(*PGStore).New()
      /Users/kotaro_abe/pkg/mod/github.com/antonlindstrom/pgstore@v0.0.0-20170604072116-a407030ba6d0/pgstore.go:105 +0x428
  github.com/gorilla/sessions.(*Registry).Get()
      /Users/kotaro_abe/pkg/mod/github.com/gorilla/sessions@v1.2.2/sessions.go:139 +0xf8
  github.com/antonlindstrom/pgstore.(*PGStore).Get()
      /Users/kotaro_abe/pkg/mod/github.com/antonlindstrom/pgstore@v0.0.0-20170604072116-a407030ba6d0/pgstore.go:78 +0x4c
  main.NewEcho.Sessions.func5.1()
...

Previous read at 0x00c000bb0950 by goroutine 130:
  github.com/gorilla/securecookie.(*SecureCookie).Decode()
      /Users/kotaro_abe/pkg/mod/github.com/gorilla/securecookie@v1.1.2/securecookie.go:339 +0x32c
  github.com/gorilla/securecookie.DecodeMulti()
      /Users/kotaro_abe/pkg/mod/github.com/gorilla/securecookie@v1.1.2/securecookie.go:594 +0x11c
  github.com/antonlindstrom/pgstore.(*PGStore).New()
      /Users/kotaro_abe/pkg/mod/github.com/antonlindstrom/pgstore@v0.0.0-20170604072116-a407030ba6d0/pgstore.go:94 +0x374
  github.com/gorilla/sessions.(*Registry).Get()
      /Users/kotaro_abe/pkg/mod/github.com/gorilla/sessions@v1.2.2/sessions.go:139 +0xf8
  github.com/antonlindstrom/pgstore.(*PGStore).Get()
      /Users/kotaro_abe/pkg/mod/github.com/antonlindstrom/pgstore@v0.0.0-20170604072116-a407030ba6d0/pgstore.go:78 +0x4c
  main.NewEcho.Sessions.func5.1()
...

Goroutine 64 (running) created at:
  net/http.(*Server).Serve()
      /usr/local/go/src/net/http/server.go:3285 +0x674
  github.com/labstack/echo/v4.(*Echo).Start()
      /Users/kotaro_abe/pkg/mod/github.com/labstack/echo/v4@v4.11.4/echo.go:686 +0x11c
...

Goroutine 130 (running) created at:
  net/http.(*Server).Serve()
      /usr/local/go/src/net/http/server.go:3285 +0x674
  github.com/labstack/echo/v4.(*Echo).Start()
      /Users/kotaro_abe/pkg/mod/github.com/labstack/echo/v4@v4.11.4/echo.go:686 +0x11c
...
@abekoh abekoh linked a pull request Mar 13, 2024 that will close this issue
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 a pull request may close this issue.

1 participant