Skip to content

data race in hystrix client #137

@ysuliu

Description

@ysuliu

We are facing the data race error using the latest code. After checking the history, you have recognized the same issue and proposed the fix in heimdall/pull/67. I have no idea why the fix hadn't been merged.

We can easily reproduce the error just by:
1, copy the unit test from test case to the latest code base.
2, run this test using "go test -race" several times

Note that, sometimes this is very easy to be reproduced (just run go test 3-5 rounds). But I also faced the case that I run about 20 rounds to get it reproduced.

==================
WARNING: DATA RACE
Write at 0x00c000191650 by goroutine 299:
  github.com/gojek/heimdall/v7/hystrix.(*Client).Do()
      /home/allen/src/go/src/gojek/heimdall/v7/hystrix/hystrix_client.go:189 +0x6b8
  github.com/gojek/heimdall/v7/hystrix.(*Client).Get()
      /home/allen/src/go/src/gojek/heimdall/v7/hystrix/hystrix_client.go:113 +0xe4
......

Previous write at 0x00c000191650 by goroutine 11006:
  github.com/gojek/heimdall/v7/hystrix.(*Client).Do.func1()
      /home/allen/src/go/src/gojek/heimdall/v7/hystrix/hystrix_client.go:190 +0xb6
  github.com/afex/hystrix-go/hystrix.Do.func1()
      /home/allen/src/go/src/github.com/afex/hystrix-go/hystrix/hystrix.go:204 +0x30
  github.com/afex/hystrix-go/hystrix.DoC.func1()
      /home/allen/src/go/src/github.com/afex/hystrix-go/hystrix/hystrix.go:221 +0x51
......

Could you please help to evaluate the issue and provide a fix?
Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions