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

core/services/ocr/plugins/llo: fix onchain cache test race #14232

Merged
merged 1 commit into from
Aug 26, 2024

Conversation

jmank88
Copy link
Contributor

@jmank88 jmank88 commented Aug 26, 2024

https://github.com/smartcontractkit/chainlink/actions/runs/10533939073/job/29190791150

==================
WARNING: DATA RACE
Read at 0x00c00566f608 by goroutine 21187:
  bytes.(*Reader).Read()
      /opt/hostedtoolcache/go/1.22.5/x64/src/bytes/reader.go:40 +0x7c
  github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/llo_test.(*MockReadCloser).Read()
      /home/runner/work/chainlink/chainlink/core/services/ocr2/plugins/llo/onchain_channel_definition_cache_integration_test.go:73 +0x2e
  net/http.(*maxBytesReader).Read()
      /opt/hostedtoolcache/go/1.22.5/x64/src/net/http/request.go:1[19](https://github.com/smartcontractkit/chainlink/actions/runs/10533939073/job/29190791150#step:19:20)7 +0x10f
  io.(*teeReader).Read()
      /opt/hostedtoolcache/go/1.22.5/x64/src/io/io.go:628 +0x5c
  io.copyBuffer()
      /opt/hostedtoolcache/go/1.22.5/x64/src/io/io.go:429 +0x29a
  io.Copy()
      /opt/hostedtoolcache/go/1.22.5/x64/src/io/io.go:388 +0xcaf
  github.com/smartcontractkit/chainlink/v2/core/services/llo.(*channelDefinitionCache).fetchChannelDefinitions()
      /home/runner/work/chainlink/chainlink/core/services/llo/onchain_channel_definition_cache.go:401 +0xc3d
  github.com/smartcontractkit/chainlink/v2/core/services/llo.(*channelDefinitionCache).fetchAndSetChannelDefinitions()
      /home/runner/work/chainlink/chainlink/core/services/llo/onchain_channel_definition_cache.go:341 +0x177
  github.com/smartcontractkit/chainlink/v2/core/services/llo.(*channelDefinitionCache).fetchLoop()
      /home/runner/work/chainlink/chainlink/core/services/llo/onchain_channel_definition_cache.go:322 +0xd1d
  github.com/smartcontractkit/chainlink/v2/core/services/llo.(*channelDefinitionCache).fetchLatestLoop.gowrap2()
      /home/runner/work/chainlink/chainlink/core/services/llo/onchain_channel_definition_cache.go:293 +0x4f

Previous write at 0x00c00566f608 by goroutine 21[20](https://github.com/smartcontractkit/chainlink/actions/runs/10533939073/job/29190791150#step:19:21)4:
  bytes.(*Reader).Seek()
      /opt/hostedtoolcache/go/1.22.5/x64/src/bytes/reader.go:132 +0x73
  github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/llo_test.(*MockReadCloser).Close()
      /home/runner/work/chainlink/chainlink/core/services/ocr2/plugins/llo/onchain_channel_definition_cache_integration_test.go:78 +0x25
  net/http.(*maxBytesReader).Close()
      /opt/hostedtoolcache/go/1.22.5/x64/src/net/http/request.go:1226 +0x42
  github.com/smartcontractkit/chainlink/v2/core/services/llo.(*channelDefinitionCache).fetchChannelDefinitions.deferwrap1()
      /home/runner/work/chainlink/chainlink/core/services/llo/onchain_channel_definition_cache.go:381 +0x42
  runtime.deferreturn()
      /opt/hostedtoolcache/go/1.22.5/x64/src/runtime/panic.go:602 +0x5d
  github.com/smartcontractkit/chainlink/v2/core/services/llo.(*channelDefinitionCache).fetchAndSetChannelDefinitions()
      /home/runner/work/chainlink/chainlink/core/services/llo/onchain_channel_definition_cache.go:341 +0x177
  github.com/smartcontractkit/chainlink/v2/core/services/llo.(*channelDefinitionCache).fetchLoop()
      /home/runner/work/chainlink/chainlink/core/services/llo/onchain_channel_definition_cache.go:309 +0x1ba
  github.com/smartcontractkit/chainlink/v2/core/services/llo.(*channelDefinitionCache).fetchLatestLoop.gowrap2()
      /home/runner/work/chainlink/chainlink/core/services/llo/onchain_channel_definition_cache.go:293 +0x4f

Goroutine [21](https://github.com/smartcontractkit/chainlink/actions/runs/10533939073/job/29190791150#step:19:22)187 (running) created at:
  github.com/smartcontractkit/chainlink/v2/core/services/llo.(*channelDefinitionCache).fetchLatestLoop()
      /home/runner/work/chainlink/chainlink/core/services/llo/onchain_channel_definition_cache.go:293 +0xc9
  github.com/smartcontractkit/chainlink/v2/core/services/llo.(*channelDefinitionCache).Start.func1.gowrap2()
      /home/runner/work/chainlink/chainlink/core/services/llo/onchain_channel_definition_cache.go:166 +0x33

Goroutine 21204 (running) created at:
  github.com/smartcontractkit/chainlink/v2/core/services/llo.(*channelDefinitionCache).fetchLatestLoop()
      /home/runner/work/chainlink/chainlink/core/services/llo/onchain_channel_definition_cache.go:[29](https://github.com/smartcontractkit/chainlink/actions/runs/10533939073/job/29190791150#step:19:30)3 +0xc9
  github.com/smartcontractkit/chainlink/v2/core/services/llo.(*channelDefinitionCache).Start.func1.gowrap2()
      /home/runner/work/chainlink/chainlink/core/services/llo/onchain_channel_definition_cache.go:166 +0x[33](https://github.com/smartcontractkit/chainlink/actions/runs/10533939073/job/29190791150#step:19:34)
==================

@jmank88 jmank88 force-pushed the llo-onchain-cache-test-race branch from a727327 to b9ac612 Compare August 26, 2024 14:23
@jmank88 jmank88 requested a review from samsondav August 26, 2024 14:23
@jmank88 jmank88 marked this pull request as ready for review August 26, 2024 14:33
@jmank88 jmank88 requested a review from a team as a code owner August 26, 2024 14:33
@jmank88 jmank88 requested review from a team and vyzaldysanchez and removed request for a team August 26, 2024 14:35
@jmank88 jmank88 enabled auto-merge August 26, 2024 14:36
@cl-sonarqube-production
Copy link

@jmank88 jmank88 added this pull request to the merge queue Aug 26, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Aug 26, 2024
@jmank88 jmank88 added this pull request to the merge queue Aug 26, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Aug 26, 2024
@jmank88 jmank88 added this pull request to the merge queue Aug 26, 2024
Merged via the queue into develop with commit 9e7406e Aug 26, 2024
133 checks passed
@jmank88 jmank88 deleted the llo-onchain-cache-test-race branch August 26, 2024 19:28
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 this pull request may close these issues.

3 participants