Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork158
Open
Description
Motivation
There is a data race on theSetBehaviour call
time="2025-01-29T14:25:31+01:00" level=info msg=" id=fUcMrGkG req=HEAD /v2/pkgs/tools/installed from=127.0.0.1"2025/01/29 14:25:31 stderr: time="2025-01-29T14:25:31+01:00" level=info msg=" id=fUcMrGkG status=200 bytes=0 time=117.031µs"2025/01/29 14:25:31 stdout: [GIN-debug] [WARNING] Headers were already written. Wanted to override status code 200 with 4002025/01/29 14:25:31 stderr: ==================2025/01/29 14:25:31 stderr: WARNING: DATA RACE2025/01/29 14:25:31 stderr: Write at 0x00c000274298 by goroutine 61:2025/01/29 14:25:31 stderr: github.com/arduino/arduino-create-agent/v2/pkgs.(*Tools).SetBehaviour()2025/01/29 14:25:31 stderr: /home/dido/code/arduino/arduino-create-agent/v2/pkgs/tools.go:336 +0xae2025/01/29 14:25:31 stderr: github.com/arduino/arduino-create-agent/tools.(*Tools).Download()2025/01/29 14:25:31 stderr: /home/dido/code/arduino/arduino-create-agent/tools/download.go:47 +0x722025/01/29 14:25:31 stderr: main.checkCmd.func2()2025/01/29 14:25:31 stderr: /home/dido/code/arduino/arduino-create-agent/hub.go:211 +0x3842025/01/29 14:25:31 stderr: 2025/01/29 14:25:31 stderr: Previous write at 0x00c000274298 by goroutine 60:2025/01/29 14:25:31 stderr: github.com/arduino/arduino-create-agent/v2/pkgs.(*Tools).SetBehaviour()2025/01/29 14:25:31 stderr: /home/dido/code/arduino/arduino-create-agent/v2/pkgs/tools.go:336 +0xae2025/01/29 14:25:31 stderr: github.com/arduino/arduino-create-agent/tools.(*Tools).Download()2025/01/29 14:25:31 stderr: /home/dido/code/arduino/arduino-create-agent/tools/download.go:47 +0x722025/01/29 14:25:31 stderr: main.checkCmd.func2()2025/01/29 14:25:31 stderr: /home/dido/code/arduino/arduino-create-agent/hub.go:211 +0x3842025/01/29 14:25:31 stderr: 2025/01/29 14:25:31 stderr: Goroutine 61 (running) created at:2025/01/29 14:25:31 stderr: main.checkCmd()2025/01/29 14:25:31 stderr: /home/dido/code/arduino/arduino-create-agent/hub.go:182 +0x7cc2025/01/29 14:25:31 stderr: main.(*hub).run()2025/01/29 14:25:31 stderr: /home/dido/code/arduino/arduino-create-agent/hub.go:111 +0x2442025/01/29 14:25:31 stderr: main.loop.gowrap2()2025/01/29 14:25:31 stderr: /home/dido/code/arduino/arduino-create-agent/main.go:385 +0x332025/01/29 14:25:31 stderr: 2025/01/29 14:25:31 stderr: Goroutine 60 (running) created at:2025/01/29 14:25:31 stderr: main.checkCmd()2025/01/29 14:25:31 stderr: /home/dido/code/arduino/arduino-create-agent/hub.go:182 +0x7cc2025/01/29 14:25:31 stderr: main.(*hub).run()2025/01/29 14:25:31 stderr: /home/dido/code/arduino/arduino-create-agent/hub.go:111 +0x2442025/01/29 14:25:31 stderr: main.loop.gowrap2()2025/01/29 14:25:31 stderr: /home/dido/code/arduino/arduino-create-agent/main.go:385 +0x332025/01/29 14:25:31 stderr: ==================2025/01/29 14:25:55 stderr: time="2025-01-29T14:25:55+01:00" level=info msg=" id=Cnx0UJtM req=HEAD /v2/pkgs/tools/installed from=127.0.0.1"