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

pubsub: TestIntegration_OrderedKeys_JSON failed #3626

Closed
flaky-bot bot opened this issue Jan 28, 2021 · 3 comments · Fixed by #4584, #4602 or #4606
Closed

pubsub: TestIntegration_OrderedKeys_JSON failed #3626

flaky-bot bot opened this issue Jan 28, 2021 · 3 comments · Fixed by #4584, #4602 or #4606
Assignees
Labels
api: pubsub Issues related to the Pub/Sub API. flakybot: flaky Tells the Flaky Bot not to close or comment on this issue. flakybot: issue An issue filed by the Flaky Bot. Should not be added manually. priority: p2 Moderately-important priority. Fix may not be included in next release. 🚨 This issue needs some love. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@flaky-bot
Copy link

flaky-bot bot commented Jan 28, 2021

This test failed!

To configure my behavior, see the Flaky Bot documentation.

If I'm commenting on this issue too often, add the flakybot: quiet label and
I will stop commenting.


commit: 98637e0
buildURL: Build Status, Sponge
status: failed

Test output
integration_test.go:1282: timed out after 60s waiting for all messages to be received
@flaky-bot flaky-bot bot added flakybot: issue An issue filed by the Flaky Bot. Should not be added manually. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Jan 28, 2021
@product-auto-label product-auto-label bot added the api: pubsub Issues related to the Pub/Sub API. label Jan 28, 2021
@flaky-bot
Copy link
Author

flaky-bot bot commented Jan 28, 2021

Looks like this issue is flaky. 😟

I'm going to leave this open and stop commenting.

A human should fix and close this.


When run at the same commit (98637e0), this test passed in one build (Build Status, Sponge) and failed in another build (Build Status, Sponge).

@flaky-bot flaky-bot bot added the flakybot: flaky Tells the Flaky Bot not to close or comment on this issue. label Jan 28, 2021
@yoshi-automation yoshi-automation added 🚨 This issue needs some love. and removed 🚨 This issue needs some love. labels Feb 2, 2021
@hongalex hongalex added priority: p2 Moderately-important priority. Fix may not be included in next release. and removed priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. labels Feb 8, 2021
@yoshi-automation yoshi-automation removed the 🚨 This issue needs some love. label Feb 8, 2021
@yoshi-automation yoshi-automation added 🚨 This issue needs some love. and removed 🚨 This issue needs some love. labels May 10, 2021
codyoss added a commit that referenced this issue Jul 21, 2021
Trying to get our builds back to green. Skipping tests, they should
be unskipped before closing the flaky bot issues.

Updates: #4325
Updates: #4173
Updates: #4418
Updates: #3626
@yoshi-automation yoshi-automation added the 🚨 This issue needs some love. label Jul 27, 2021
gcf-merge-on-green bot pushed a commit that referenced this issue Aug 10, 2021
From discussion with @kamalaboulhosn, increasing the test timeout for this ordering key test should help with flakiness.

Fixes #3626
@flaky-bot flaky-bot bot reopened this Aug 11, 2021
@flaky-bot
Copy link
Author

flaky-bot bot commented Aug 11, 2021

Oops! Looks like this issue is still flaky. It failed again. 😬

I reopened the issue, but a human will need to close it again.


commit: 5996846
buildURL: Build Status, Sponge
status: failed

Test output
==================
WARNING: DATA RACE
Write at 0x00c000b32148 by goroutine 215:
  cloud.google.com/go/pubsub.(*Subscription).checkOrdering()
      /tmpfs/src/google-cloud-go/pubsub/subscription.go:968 +0x150
  cloud.google.com/go/pubsub.(*Subscription).checkOrdering-fm()
      /tmpfs/src/google-cloud-go/pubsub/subscription.go:918 +0x41
  sync.(*Once).Do()
      /usr/local/go/src/sync/once.go:44 +0xde
  cloud.google.com/go/pubsub.(*Subscription).Receive.func2()
      /tmpfs/src/google-cloud-go/pubsub/subscription.go:918 +0x674
  golang.org/x/sync/errgroup.(*Group).Go.func1()
      /go/pkg/mod/golang.org/x/sync@v0.0.0-20210220032951-036812b2e83c/errgroup/errgroup.go:57 +0x64

Previous read at 0x00c000b32148 by goroutine 178:
cloud.google.com/go/pubsub.(*Subscription).Receive.func2()
/tmpfs/src/google-cloud-go/pubsub/subscription.go:922 +0x3fc
golang.org/x/sync/errgroup.(*Group).Go.func1()
/go/pkg/mod/golang.org/x/sync@v0.0.0-20210220032951-036812b2e83c/errgroup/errgroup.go:57 +0x64

Goroutine 215 (running) created at:
golang.org/x/sync/errgroup.(*Group).Go()
/go/pkg/mod/golang.org/x/sync@v0.0.0-20210220032951-036812b2e83c/errgroup/errgroup.go:54 +0x73
cloud.google.com/go/pubsub.(*Subscription).Receive()
/tmpfs/src/google-cloud-go/pubsub/subscription.go:864 +0x641
cloud.google.com/go/pubsub.TestIntegration_OrderedKeys_JSON.func1()
/tmpfs/src/google-cloud-go/pubsub/integration_test.go:1260 +0x156

Goroutine 178 (running) created at:
golang.org/x/sync/errgroup.(*Group).Go()
/go/pkg/mod/golang.org/x/sync@v0.0.0-20210220032951-036812b2e83c/errgroup/errgroup.go:54 +0x73
cloud.google.com/go/pubsub.(*Subscription).Receive()
/tmpfs/src/google-cloud-go/pubsub/subscription.go:864 +0x641
cloud.google.com/go/pubsub.TestIntegration_OrderedKeys_JSON.func1()
/tmpfs/src/google-cloud-go/pubsub/integration_test.go:1260 +0x156

testing.go:771: race detected during execution of test

gcf-merge-on-green bot pushed a commit that referenced this issue Aug 12, 2021
We use `sync.once.Do(s.checkOrdering)` to perform one config check for a subscription's message ordering field when a message with an ordering key is received. This way, we know if we should deliver messages in order. However, since `sub.Receive` generates multiple goroutines, `s.enableOrdering` is not guaranteed to be read after the first invocation of `s.checkOrdering`. This PR makes this race happen less often by making the config check closer to when the message is received.

This cannot be fully eliminated without making the config call at the start of every single `Receive`. This behavior is less desirable, as we want to make the config call only when we have to, that is when we receive a message with an ordering key. 

Fixes #3626
@flaky-bot
Copy link
Author

flaky-bot bot commented Aug 12, 2021

Oops! Looks like this issue is still flaky. It failed again. 😬

I reopened the issue, but a human will need to close it again.


commit: a38d037
buildURL: Build Status, Sponge
status: failed

Test output
==================
WARNING: DATA RACE
Write at 0x00c000364538 by goroutine 207:
  cloud.google.com/go/pubsub.(*Subscription).checkOrdering()
      /tmpfs/src/google-cloud-go/pubsub/subscription.go:968 +0x150
  cloud.google.com/go/pubsub.(*Subscription).checkOrdering-fm()
      /tmpfs/src/google-cloud-go/pubsub/subscription.go:901 +0x41
  sync.(*Once).Do()
      /usr/local/go/src/sync/once.go:44 +0xde
  cloud.google.com/go/pubsub.(*Subscription).Receive.func2()
      /tmpfs/src/google-cloud-go/pubsub/subscription.go:901 +0x79d
  golang.org/x/sync/errgroup.(*Group).Go.func1()
      /go/pkg/mod/golang.org/x/sync@v0.0.0-20210220032951-036812b2e83c/errgroup/errgroup.go:57 +0x64

Previous read at 0x00c000364538 by goroutine 186:
cloud.google.com/go/pubsub.(*Subscription).Receive.func2()
/tmpfs/src/google-cloud-go/pubsub/subscription.go:922 +0x3f4
golang.org/x/sync/errgroup.(*Group).Go.func1()
/go/pkg/mod/golang.org/x/sync@v0.0.0-20210220032951-036812b2e83c/errgroup/errgroup.go:57 +0x64

Goroutine 207 (running) created at:
golang.org/x/sync/errgroup.(*Group).Go()
/go/pkg/mod/golang.org/x/sync@v0.0.0-20210220032951-036812b2e83c/errgroup/errgroup.go:54 +0x73
cloud.google.com/go/pubsub.(*Subscription).Receive()
/tmpfs/src/google-cloud-go/pubsub/subscription.go:864 +0x641
cloud.google.com/go/pubsub.TestIntegration_OrderedKeys_JSON.func1()
/tmpfs/src/google-cloud-go/pubsub/integration_test.go:1260 +0x156

Goroutine 186 (running) created at:
golang.org/x/sync/errgroup.(*Group).Go()
/go/pkg/mod/golang.org/x/sync@v0.0.0-20210220032951-036812b2e83c/errgroup/errgroup.go:54 +0x73
cloud.google.com/go/pubsub.(*Subscription).Receive()
/tmpfs/src/google-cloud-go/pubsub/subscription.go:864 +0x641
cloud.google.com/go/pubsub.TestIntegration_OrderedKeys_JSON.func1()
/tmpfs/src/google-cloud-go/pubsub/integration_test.go:1260 +0x156

testing.go:771: race detected during execution of test

gcf-merge-on-green bot pushed a commit that referenced this issue Aug 13, 2021
In the previous iteration of this PR, #4602, the assumption was made that making the config check earlier will prevent race conditions in the test, which turned out to be incorrect. In addition, although previously ruled out as a solution, this PR makes it so that a config check is always made on the first call to `Receive`. I originally thought this would result in a poor experience for those users who don't have the `roles/pubsub.viewer` permission, but we default `enableOrdering` to `true` anyway if the config call fails due to lack of permissions. Using a default of `true` only negatively impacts those who don't want ordering on their subscription, and this behavior is [already documented](https://github.com/googleapis/google-cloud-go/blob/pubsub/v1.14.0/pubsub/subscription.go#L235-L239).

Fixes #3626
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: pubsub Issues related to the Pub/Sub API. flakybot: flaky Tells the Flaky Bot not to close or comment on this issue. flakybot: issue An issue filed by the Flaky Bot. Should not be added manually. priority: p2 Moderately-important priority. Fix may not be included in next release. 🚨 This issue needs some love. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
2 participants