You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We get a RACE error on running tests in the production with the flag -race enabled.
And the stack shows it comes from here:
I believe that the reason is multiple goroutines are calling method ExpTaylor and this method manipulates the shared variable factorials (https://github.com/shopspring/decimal/blob/master/decimal.go#L84).
As you used a global variable for caching factorials (#229), it's not goroutine safe and should have a lock.
The text was updated successfully, but these errors were encountered:
Hi @nasermirzaei89! Thanks for bringing this issue up.
I was aware of this potential race condition problem during the implementation of ExpTaylor, but I though my lock-less approach would be sufficient for - https://github.com/shopspring/decimal/blob/master/decimal.go#L1089:L1099. I guess I was wrong, I would need to take a closer look on that 👀
We get a RACE error on running tests in the production with the flag
-race
enabled.And the stack shows it comes from here:
I believe that the reason is multiple goroutines are calling method
ExpTaylor
and this method manipulates the shared variablefactorials
(https://github.com/shopspring/decimal/blob/master/decimal.go#L84).As you used a global variable for caching factorials (#229), it's not goroutine safe and should have a lock.
The text was updated successfully, but these errors were encountered: