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

[bug]: observed data race in router unit test #8964

Closed
hieblmi opened this issue Aug 1, 2024 · 3 comments · Fixed by #8977
Closed

[bug]: observed data race in router unit test #8964

hieblmi opened this issue Aug 1, 2024 · 3 comments · Fixed by #8977
Assignees
Labels
bug Unintended code behaviour needs triage tests

Comments

@hieblmi
Copy link
Collaborator

hieblmi commented Aug 1, 2024

Background

Observed the following race condition in make btcd unit-race

==================
WARNING: DATA RACE
Write at 0x00c000371910 by goroutine 4238:
  github.com/lightningnetwork/lnd/routing.TestNewRouteRequest.func1()
      /home/runner/work/lnd/lnd/routing/router_test.go:2239 +0x155
  testing.tRunner()
      /opt/hostedtoolcache/go/1.22.5/x64/src/testing/testing.go:1689 +0x21e
  testing.(*T).Run.gowrap1()
      /opt/hostedtoolcache/go/1.22.5/x64/src/testing/testing.go:1742 +0x44

Previous write at 0x00c000371910 by goroutine 4240:
  github.com/lightningnetwork/lnd/routing.TestNewRouteRequest.func1()
      /home/runner/work/lnd/lnd/routing/router_test.go:2239 +0x155
  testing.tRunner()
      /opt/hostedtoolcache/go/1.22.5/x64/src/testing/testing.go:1689 +0x21e
  testing.(*T).Run.gowrap1()
      /opt/hostedtoolcache/go/1.22.5/x64/src/testing/testing.go:1742 +0x44

Goroutine 4238 (running) created at:
  testing.(*T).Run()
      /opt/hostedtoolcache/go/1.22.5/x64/src/testing/testing.go:1742 +0x825
  github.com/lightningnetwork/lnd/routing.TestNewRouteRequest()
      /home/runner/work/lnd/lnd/routing/router_test.go:2[231](https://github.com/lightningnetwork/lnd/actions/runs/10194791831/job/28202115109?pr=8836#step:8:232) +0x1230
  testing.tRunner()
      /opt/hostedtoolcache/go/1.22.5/x64/src/testing/testing.go:1689 +0x21e
  testing.(*T).Run.gowrap1()
      /opt/hostedtoolcache/go/1.22.5/x64/src/testing/testing.go:1742 +0x44

Goroutine 4240 (finished) created at:
  testing.(*T).Run()
      /opt/hostedtoolcache/go/1.22.5/x64/src/testing/testing.go:1742 +0x825
  github.com/lightningnetwork/lnd/routing.TestNewRouteRequest()
      /home/runner/work/lnd/lnd/routing/router_test.go:2231 +0x1230
  testing.tRunner()
      /opt/hostedtoolcache/go/1.22.5/x64/src/testing/testing.go:1689 +0x21e
  testing.(*T).Run.gowrap1()
      /opt/hostedtoolcache/go/1.22.5/x64/src/testing/testing.go:1742 +0x44
==================

Your environment

  • version of lnd commit 04dde98edcc0a85699986374ef950687cd043871 inbetween v0.18.2 and v0.18.3
@hieblmi hieblmi added bug Unintended code behaviour needs triage tests labels Aug 1, 2024
@yyforyongyu
Copy link
Collaborator

looks like there's another race from this build when merging #8764,

--- FAIL: TestMigrations (0.00s)
    --- FAIL: TestMigrations/TestInvoiceExpiryMigration_Postgres (15.04s)
        postgres_fixture.go:70: 
            	Error Trace:	/home/runner/work/lnd/lnd/sqldb/postgres_fixture.go:70
            	            				/home/runner/work/lnd/lnd/sqldb/migrations_test.go:30
            	            				/home/runner/work/lnd/lnd/sqldb/migrations_test.go:75
            	            				/home/runner/work/lnd/lnd/sqldb/migrations_test.go:60
            	Error:      	Received unexpected error:
            	            	API error (500): Get "https://registry-1.docker.io/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
            	Test:       	TestMigrations/TestInvoiceExpiryMigration_Postgres
            	Messages:   	Could not start resource
FAIL
FAIL	github.com/lightningnetwork/lnd/sqldb	15.051s
FAIL
ok  	github.com/lightningnetwork/lnd/zpay32	1.995s
--- FAIL: TestInvoiceRegistry (15.01s)
    postgres_fixture.go:70: 
        	Error Trace:	/home/runner/work/lnd/lnd/sqldb/postgres_fixture.go:70
        	            				/home/runner/work/lnd/lnd/invoices/invoiceregistry_test.go:121
        	Error:      	Received unexpected error:
        	            	API error (500): Get "https://registry-1.docker.io/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
        	Test:       	TestInvoiceRegistry
        	Messages:   	Could not start resource
--- FAIL: TestInvoices (15.01s)
    postgres_fixture.go:70: 
        	Error Trace:	/home/runner/work/lnd/lnd/sqldb/postgres_fixture.go:70
        	            				/home/runner/work/lnd/lnd/invoices/invoices_test.go:227
        	Error:      	Received unexpected error:
        	            	API error (500): Get "https://registry-1.docker.io/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
        	Test:       	TestInvoices
        	Messages:   	Could not start resource
FAIL
FAIL	github.com/lightningnetwork/lnd/invoices	30.208s
FAIL

@Roasbeef
Copy link
Member

Roasbeef commented Aug 1, 2024

@yyforyongyu is that a race? That just looks like the docker API timing out.

@ellemouton
Copy link
Collaborator

ellemouton commented Aug 5, 2024

Hey yall - fixing this in the route blinding follow up PR 👍 (well, at least the TestNewRouteRequest part. i think the TestInvoiceExpiryMigration_Postgres is separate)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unintended code behaviour needs triage tests
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants