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

*: fix github actions #330

Merged
merged 2 commits into from
Sep 12, 2021
Merged

Conversation

mreiferson
Copy link
Member

No description provided.

@ploxiln
Copy link
Member

ploxiln commented Sep 12, 2021

--- FAIL: TestFullJitterBackoff (0.00s)
panic: invalid argument to Intn [recovered]
	panic: invalid argument to Intn

goroutine 9 [running]:
testing.tRunner.func1.2({0x82fcd00, 0x83aa4f8})
	/usr/local/go/src/testing/testing.go:1209 +0x2ab
testing.tRunner.func1(0xa0014a0)
	/usr/local/go/src/testing/testing.go:1212 +0x27d
panic({0x82fcd00, 0x83aa4f8})
	/usr/local/go/src/runtime/panic.go:1038 +0x1c5
math/rand.(*Rand).Intn(0xa00ec00, 0xdcd65000)
	/usr/local/go/src/math/rand/rand.go:168 +0x7d
github.com/nsqio/go-nsq.(*FullJitterStrategy).Calculate(0xa1061f8, 0x3)
	/__w/go-nsq/go-nsq/go/src/github.com/nsqio/go-nsq/config.go:75 +0xac
	backoffDuration := s.cfg.BackoffMultiplier *
		time.Duration(math.Pow(2, float64(attempt)))
	return time.Duration(s.rng.Intn(int(backoffDuration)))

I think int(backoffDuration) ended up being 0 ?

@ploxiln
Copy link
Member

ploxiln commented Sep 12, 2021

... oh, wraparound, that would also do it

@mreiferson
Copy link
Member Author

I'm not sure how this ever passed on 386?

@mreiferson
Copy link
Member Author

well, that was fun

@mreiferson mreiferson merged commit 3bce8d0 into nsqio:master Sep 12, 2021
@mreiferson mreiferson deleted the github-actions-fix branch September 12, 2021 22:52
@ploxiln
Copy link
Member

ploxiln commented Sep 12, 2021

nice little fix for 32-bit architectures!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants