Skip to content

[Flaky Test]: TestInspect – Exception 0xc0000005 0x8 0x0 0x0 #7185

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

Open
pkoutsovasilis opened this issue Mar 4, 2025 · 3 comments
Open
Labels
flaky-test Unstable or unreliable test cases. Team:Elastic-Agent Label for the Agent team

Comments

@pkoutsovasilis
Copy link
Contributor

pkoutsovasilis commented Mar 4, 2025

Failing test case

TestInspect

Error message

Exception 0xc0000005 0x8 0x0 0x0

Build

https://buildkite.com/elastic/elastic-agent/builds/18051#01956207-776a-4c81-9974-526b3a299f10/311-1026

OS

Windows

Stacktrace and notes

Exception 0xc0000005 0x8 0x0 0x0
PC=0x0

runtime: g 1 gp=0xc0000f8000: unknown pc 0xc001310820
stack: frame={sp:0xc000c7ee28, fp:0x0} stack=[0xc000c70000,0xc000c80000)
0x000000c000c7ed28:  0x0000000000000003  0x000000c000c7edb0
0x000000c000c7ed38:  0x000000000054f4ef <go.uber.org/zap/zapcore.(*jsonEncoder).addKey+0x000000000000024f>  0x000000c001310820
0x000000c000c7ed48:  0x000000000a67c6a8  0x000000000a67c728
0x000000c000c7ed58:  0x000000c000f8cae0  0x000000000a2780df
0x000000c000c7ed68:  0x0000000000000005  0x000000c000c7ed88
0x000000c000c7ed78:  0x0000000000000003  0x0000000000000003
0x000000c000c7ed88:  0x00000000088c9da0  0x000000c00129a1f0
0x000000c000c7ed98:  0x00000000088c9da0  0x000000c00129a200
0x000000c000c7eda8:  0x000000000941f4c0  0x000000c000c7ee88
0x000000c000c7edb8:  0x000000000055a00e <go.uber.org/zap/zapcore.consoleEncoder.OpenNamespace+0x000000000000002e>  0x000000c001298540
0x000000c000c7edc8:  0x000000000a2780df  0x0000000000000005
0x000000c000c7edd8:  0x000000000033f705 <sync.(*Pool).Get+0x0000000000000085>  0x000000000000002a
0x000000c000c7ede8:  0x0000000000000030  0x0100000000000030
0x000000c000c7edf8:  0x000000c000c7ee50  0x00000000000000c5
0x000000c000c7ee08:  0x000000c001298540  0x0000000000000000
0x000000c000c7ee18:  0x0000000000000000  0x000000c001310820
0x000000c000c7ee28: <0x000000c00a2780df  0x00000000005496c0 <go.uber.org/zap/zapcore.encodeError.func1+0x0000000000000000>
0x000000c000c7ee38:  0x000000000b1bd460  0x000000c000eeba40
0x000000c000c7ee48:  0x0000021cf898e5f8  0x000000c001298540
0x000000c000c7ee58:  0x000000000a2780df  0x0000000000000005
0x000000c000c7ee68:  0x000000c000c7ee10  0x000000c0010f1f80
0x000000c000c7ee78:  0x000000c001298540  0x000000c000c7ee30
0x000000c000c7ee88:  0x000000c000c7ef18  0x000000000054a56b <go.uber.org/zap/zapcore.Field.AddTo+0x00000000000009cb>
0x000000c000c7ee98:  0x000000000a2780df  0x0000000000000005
0x000000c000c7eea8:  0x000000000b1bd460  0x000000c000eeba40
0x000000c000c7eeb8:  0x0000021cf898e5f8  0x000000c001298540
0x000000c000c7eec8:  0x000000c000db6008  0x000000c000eebaa0
0x000000c000c7eed8:  0x000000c000c7ef18  0x00000000002b023f <runtime.typeAssert+0x000000000000003f>
0x000000c000c7eee8:  0x0000000009e31300  0x000000000a207be0
0x000000c000c7eef8:  0x00000000002b2601 <runtime.deductAssistCredit+0x0000000000000061>  0x000000c000eeba40
0x000000c000c7ef08:  0x00000000098ec480  0x000000c000c7ef01
0x000000c000c7ef18:  0x000000c000c7efe0  0x00000000005463fe <go.uber.org/zap/zapcore.(*ioCore).With+0x000000000000019e>
runtime: g 1 gp=0xc0000f8000: unknown pc 0xc001310820
stack: frame={sp:0xc000c7ee28, fp:0x0} stack=[0xc000c70000,0xc000c80000)
0x000000c000c7ed28:  0x0000000000000003  0x000000c000c7edb0
0x000000c000c7ed38:  0x000000000054f4ef <go.uber.org/zap/zapcore.(*jsonEncoder).addKey+0x000000000000024f>  0x000000c001310820
0x000000c000c7ed48:  0x000000000a67c6a8  0x000000000a67c728
0x000000c000c7ed58:  0x000000c000f8cae0  0x000000000a2780df
0x000000c000c7ed68:  0x0000000000000005  0x000000c000c7ed88
0x000000c000c7ed78:  0x0000000000000003  0x0000000000000003
0x000000c000c7ed88:  0x00000000088c9da0  0x000000c00129a1f0
0x000000c000c7ed98:  0x00000000088c9da0  0x000000c00129a200
0x000000c000c7eda8:  0x000000000941f4c0  0x000000c000c7ee88
0x000000c000c7edb8:  0x000000000055a00e <go.uber.org/zap/zapcore.consoleEncoder.OpenNamespace+0x000000000000002e>  0x000000c001298540
0x000000c000c7edc8:  0x000000000a2780df  0x0000000000000005
0x000000c000c7edd8:  0x000000000033f705 <sync.(*Pool).Get+0x0000000000000085>  0x000000000000002a
0x000000c000c7ede8:  0x0000000000000030  0x0100000000000030
0x000000c000c7edf8:  0x000000c000c7ee50  0x00000000000000c5
0x000000c000c7ee08:  0x000000c001298540  0x0000000000000000
0x000000c000c7ee18:  0x0000000000000000  0x000000c001310820
0x000000c000c7ee28: <0x000000c00a2780df  0x00000000005496c0 <go.uber.org/zap/zapcore.encodeError.func1+0x0000000000000000>
0x000000c000c7ee38:  0x000000000b1bd460  0x000000c000eeba40
0x000000c000c7ee48:  0x0000021cf898e5f8  0x000000c001298540
0x000000c000c7ee58:  0x000000000a2780df  0x0000000000000005
0x000000c000c7ee68:  0x000000c000c7ee10  0x000000c0010f1f80
0x000000c000c7ee78:  0x000000c001298540  0x000000c000c7ee30
0x000000c000c7ee88:  0x000000c000c7ef18  0x000000000054a56b <go.uber.org/zap/zapcore.Field.AddTo+0x00000000000009cb>
0x000000c000c7ee98:  0x000000000a2780df  0x0000000000000005
0x000000c000c7eea8:  0x000000000b1bd460  0x000000c000eeba40
0x000000c000c7eeb8:  0x0000021cf898e5f8  0x000000c001298540
0x000000c000c7eec8:  0x000000c000db6008  0x000000c000eebaa0
0x000000c000c7eed8:  0x000000c000c7ef18  0x00000000002b023f <runtime.typeAssert+0x000000000000003f>
0x000000c000c7eee8:  0x0000000009e31300  0x000000000a207be0
0x000000c000c7eef8:  0x00000000002b2601 <runtime.deductAssistCredit+0x0000000000000061>  0x000000c000eeba40
0x000000c000c7ef08:  0x00000000098ec480  0x000000c000c7ef01
0x000000c000c7ef18:  0x000000c000c7efe0  0x00000000005463fe <go.uber.org/zap/zapcore.(*ioCore).With+0x000000000000019e>

goroutine 2 gp=0xc0000f8700 m=nil [force gc (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
        runtime/proc.go:424 +0xce fp=0xc000101fa8 sp=0xc000101f88 pc=0x31828e
runtime.goparkunlock(...)
        runtime/proc.go:430
runtime.forcegchelper()
        runtime/proc.go:337 +0xb8 fp=0xc000101fe0 sp=0xc000101fa8 pc=0x2e31d8
runtime.goexit({})
        runtime/asm_amd64.s:1700 +0x1 fp=0xc000101fe8 sp=0xc000101fe0 pc=0x321101
created by runtime.init.7 in goroutine 1
        runtime/proc.go:325 +0x1a

goroutine 3 gp=0xc0000f8a80 m=nil [GC sweep wait]:
runtime.gopark(0x1?, 0x0?, 0x0?, 0x0?, 0x0?)
        runtime/proc.go:424 +0xce fp=0xc000103f80 sp=0xc000103f60 pc=0x31828e
runtime.goparkunlock(...)
        runtime/proc.go:430
runtime.bgsweep(0xc0000c0300)
        runtime/mgcsweep.go:317 +0xdf fp=0xc000103fc8 sp=0xc000103f80 pc=0x2c899f
runtime.gcenable.gowrap1()
        runtime/mgc.go:204 +0x25 fp=0xc000103fe0 sp=0xc000103fc8 pc=0x2bcfc5
runtime.goexit({})
        runtime/asm_amd64.s:1700 +0x1 fp=0xc000103fe8 sp=0xc000103fe0 pc=0x321101
created by runtime.gcenable in goroutine 1
        runtime/mgc.go:204 +0x66

goroutine 4 gp=0xc0000f8c40 m=nil [GC scavenge wait]:
runtime.gopark(0x10000?, 0xb17d980?, 0x0?, 0x0?, 0x0?)
        runtime/proc.go:424 +0xce fp=0xc00010ff78 sp=0xc00010ff58 pc=0x31828e
runtime.goparkunlock(...)
        runtime/proc.go:430
runtime.(*scavengerState).park(0x1082b560)
        runtime/mgcscavenge.go:425 +0x49 fp=0xc00010ffa8 sp=0xc00010ff78 pc=0x2c6369
runtime.bgscavenge(0xc0000c0300)
        runtime/mgcscavenge.go:658 +0x59 fp=0xc00010ffc8 sp=0xc00010ffa8 pc=0x2c68f9
runtime.gcenable.gowrap2()
        runtime/mgc.go:205 +0x25 fp=0xc00010ffe0 sp=0xc00010ffc8 pc=0x2bcf65
runtime.goexit({})
        runtime/asm_amd64.s:1700 +0x1 fp=0xc00010ffe8 sp=0xc00010ffe0 pc=0x321101
created by runtime.gcenable in goroutine 1
        runtime/mgc.go:205 +0xa5

goroutine 5 gp=0xc0000f9180 m=nil [finalizer wait]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
        runtime/proc.go:424 +0xce fp=0xc000111e20 sp=0xc000111e00 pc=0x31828e
runtime.runfinq()
        runtime/mfinal.go:193 +0x107 fp=0xc000111fe0 sp=0xc000111e20 pc=0x2bc087
runtime.goexit({})
        runtime/asm_amd64.s:1700 +0x1 fp=0xc000111fe8 sp=0xc000111fe0 pc=0x321101
created by runtime.createfing in goroutine 1
        runtime/mfinal.go:163 +0x3d

goroutine 6 gp=0xc0003a8c40 m=nil [GC worker (idle)]:
runtime.gopark(0x106f8ea8ff8?, 0x3?, 0x9c?, 0x8e?, 0x7bc1860?)
        runtime/proc.go:424 +0xce fp=0xc000105f38 sp=0xc000105f18 pc=0x31828e
runtime.gcBgMarkWorker(0xc0000bc380)
        runtime/mgc.go:1412 +0xe9 fp=0xc000105fc8 sp=0xc000105f38 pc=0x2bf3a9
runtime.gcBgMarkStartWorkers.gowrap1()
        runtime/mgc.go:1328 +0x25 fp=0xc000105fe0 sp=0xc000105fc8 pc=0x2bf285
runtime.goexit({})
        runtime/asm_amd64.s:1700 +0x1 fp=0xc000105fe8 sp=0xc000105fe0 pc=0x321101
created by runtime.gcBgMarkStartWorkers in goroutine 1
        runtime/mgc.go:1328 +0x105

goroutine 18 gp=0xc0001861c0 m=nil [GC worker (idle)]:
runtime.gopark(0x106f9016354?, 0x3?, 0x0?, 0x0?, 0x0?)
        runtime/proc.go:424 +0xce fp=0xc00010bf38 sp=0xc00010bf18 pc=0x31828e
runtime.gcBgMarkWorker(0xc0000bc380)
        runtime/mgc.go:1412 +0xe9 fp=0xc00010bfc8 sp=0xc00010bf38 pc=0x2bf3a9
runtime.gcBgMarkStartWorkers.gowrap1()
        runtime/mgc.go:1328 +0x25 fp=0xc00010bfe0 sp=0xc00010bfc8 pc=0x2bf285
runtime.goexit({})
        runtime/asm_amd64.s:1700 +0x1 fp=0xc00010bfe8 sp=0xc00010bfe0 pc=0x321101
created by runtime.gcBgMarkStartWorkers in goroutine 1
        runtime/mgc.go:1328 +0x105

goroutine 34 gp=0xc00035c000 m=nil [GC worker (idle)]:
runtime.gopark(0x106f9016354?, 0x3?, 0xc8?, 0x7a?, 0x0?)
        runtime/proc.go:424 +0xce fp=0xc0004a5f38 sp=0xc0004a5f18 pc=0x31828e
runtime.gcBgMarkWorker(0xc0000bc380)
        runtime/mgc.go:1412 +0xe9 fp=0xc0004a5fc8 sp=0xc0004a5f38 pc=0x2bf3a9
runtime.gcBgMarkStartWorkers.gowrap1()
        runtime/mgc.go:1328 +0x25 fp=0xc0004a5fe0 sp=0xc0004a5fc8 pc=0x2bf285
runtime.goexit({})
        runtime/asm_amd64.s:1700 +0x1 fp=0xc0004a5fe8 sp=0xc0004a5fe0 pc=0x321101
created by runtime.gcBgMarkStartWorkers in goroutine 1
        runtime/mgc.go:1328 +0x105

goroutine 7 gp=0xc0003a8e00 m=nil [GC worker (idle)]:
runtime.gopark(0x106f9016354?, 0x0?, 0x0?, 0x0?, 0x0?)
        runtime/proc.go:424 +0xce fp=0xc0004a1f38 sp=0xc0004a1f18 pc=0x31828e
runtime.gcBgMarkWorker(0xc0000bc380)
        runtime/mgc.go:1412 +0xe9 fp=0xc0004a1fc8 sp=0xc0004a1f38 pc=0x2bf3a9
runtime.gcBgMarkStartWorkers.gowrap1()
        runtime/mgc.go:1328 +0x25 fp=0xc0004a1fe0 sp=0xc0004a1fc8 pc=0x2bf285
runtime.goexit({})
        runtime/asm_amd64.s:1700 +0x1 fp=0xc0004a1fe8 sp=0xc0004a1fe0 pc=0x321101
created by runtime.gcBgMarkStartWorkers in goroutine 1
        runtime/mgc.go:1328 +0x105

goroutine 19 gp=0xc000186380 m=nil [GC worker (idle)]:
runtime.gopark(0x106f8ea8ff8?, 0x0?, 0x0?, 0x0?, 0x0?)
        runtime/proc.go:424 +0xce fp=0xc00010df38 sp=0xc00010df18 pc=0x31828e
runtime.gcBgMarkWorker(0xc0000bc380)
        runtime/mgc.go:1412 +0xe9 fp=0xc00010dfc8 sp=0xc00010df38 pc=0x2bf3a9
runtime.gcBgMarkStartWorkers.gowrap1()
        runtime/mgc.go:1328 +0x25 fp=0xc00010dfe0 sp=0xc00010dfc8 pc=0x2bf285
runtime.goexit({})
        runtime/asm_amd64.s:1700 +0x1 fp=0xc00010dfe8 sp=0xc00010dfe0 pc=0x321101
created by runtime.gcBgMarkStartWorkers in goroutine 1
        runtime/mgc.go:1328 +0x105

goroutine 35 gp=0xc00035c1c0 m=nil [GC worker (idle)]:
runtime.gopark(0x106f8ea8ff8?, 0x1?, 0x9c?, 0x8e?, 0x0?)
        runtime/proc.go:424 +0xce fp=0xc0004a7f38 sp=0xc0004a7f18 pc=0x31828e
runtime.gcBgMarkWorker(0xc0000bc380)
        runtime/mgc.go:1412 +0xe9 fp=0xc0004a7fc8 sp=0xc0004a7f38 pc=0x2bf3a9
runtime.gcBgMarkStartWorkers.gowrap1()
        runtime/mgc.go:1328 +0x25 fp=0xc0004a7fe0 sp=0xc0004a7fc8 pc=0x2bf285
runtime.goexit({})
        runtime/asm_amd64.s:1700 +0x1 fp=0xc0004a7fe8 sp=0xc0004a7fe0 pc=0x321101
created by runtime.gcBgMarkStartWorkers in goroutine 1
        runtime/mgc.go:1328 +0x105

goroutine 8 gp=0xc0003a8fc0 m=nil [GC worker (idle)]:
runtime.gopark(0x106f9016354?, 0x0?, 0x0?, 0x0?, 0x0?)
        runtime/proc.go:424 +0xce fp=0xc0004a3f38 sp=0xc0004a3f18 pc=0x31828e
runtime.gcBgMarkWorker(0xc0000bc380)
        runtime/mgc.go:1412 +0xe9 fp=0xc0004a3fc8 sp=0xc0004a3f38 pc=0x2bf3a9
runtime.gcBgMarkStartWorkers.gowrap1()
        runtime/mgc.go:1328 +0x25 fp=0xc0004a3fe0 sp=0xc0004a3fc8 pc=0x2bf285
runtime.goexit({})
        runtime/asm_amd64.s:1700 +0x1 fp=0xc0004a3fe8 sp=0xc0004a3fe0 pc=0x321101
created by runtime.gcBgMarkStartWorkers in goroutine 1
        runtime/mgc.go:1328 +0x105

goroutine 20 gp=0xc000186540 m=nil [GC worker (idle)]:
runtime.gopark(0x106d20982b8?, 0x3?, 0x0?, 0x0?, 0x0?)
        runtime/proc.go:424 +0xce fp=0xc000191f38 sp=0xc000191f18 pc=0x31828e
runtime.gcBgMarkWorker(0xc0000bc380)
        runtime/mgc.go:1412 +0xe9 fp=0xc000191fc8 sp=0xc000191f38 pc=0x2bf3a9
runtime.gcBgMarkStartWorkers.gowrap1()
        runtime/mgc.go:1328 +0x25 fp=0xc000191fe0 sp=0xc000191fc8 pc=0x2bf285
runtime.goexit({})
        runtime/asm_amd64.s:1700 +0x1 fp=0xc000191fe8 sp=0xc000191fe0 pc=0x321101
created by runtime.gcBgMarkStartWorkers in goroutine 1
        runtime/mgc.go:1328 +0x105

goroutine 21 gp=0xc000686380 m=nil [select]:
runtime.gopark(0xc00018ff78?, 0x3?, 0x90?, 0x0?, 0xc00018ff72?)
        runtime/proc.go:424 +0xce fp=0xc00018fe10 sp=0xc00018fdf0 pc=0x31828e
runtime.selectgo(0xc00018ff78, 0xc00018ff6c, 0xc00035e700?, 0x0, 0x0?, 0x1)
        runtime/select.go:335 +0x7a5 fp=0xc00018ff38 sp=0xc00018fe10 pc=0x2f4e65
go.opencensus.io/stats/view.(*worker).start(0xc00035e700)
        [email protected]/stats/view/worker.go:292 +0x9f fp=0xc00018ffc8 sp=0xc00018ff38 pc=0x5f0ac9f
go.opencensus.io/stats/view.init.0.gowrap1()
        [email protected]/stats/view/worker.go:34 +0x25 fp=0xc00018ffe0 sp=0xc00018ffc8 pc=0x5f0a005
runtime.goexit({})
        runtime/asm_amd64.s:1700 +0x1 fp=0xc00018ffe8 sp=0xc00018ffe0 pc=0x321101
created by go.opencensus.io/stats/view.init.0 in goroutine 1
        [email protected]/stats/view/worker.go:34 +0x8d

goroutine 22 gp=0xc000686540 m=nil [chan receive]:
runtime.gopark(0xc000193f60?, 0x408c85?, 0x80?, 0x59?, 0xb349460?)
        runtime/proc.go:424 +0xce fp=0xc000193f18 sp=0xc000193ef8 pc=0x31828e
runtime.chanrecv(0xc0000bcfc0, 0x0, 0x1)
        runtime/chan.go:639 +0x41e fp=0xc000193f90 sp=0xc000193f18 pc=0x2ab11e
runtime.chanrecv1(0x0?, 0x0?)
        runtime/chan.go:489 +0x12 fp=0xc000193fb8 sp=0xc000193f90 pc=0x2aacd2
runtime.unique_runtime_registerUniqueMapCleanup.func1(...)
        runtime/mgc.go:1781
runtime.unique_runtime_registerUniqueMapCleanup.gowrap1()
        runtime/mgc.go:1784 +0x2f fp=0xc000193fe0 sp=0xc000193fb8 pc=0x2c00af
runtime.goexit({})
        runtime/asm_amd64.s:1700 +0x1 fp=0xc000193fe8 sp=0xc000193fe0 pc=0x321101
created by unique.runtime_registerUniqueMapCleanup in goroutine 1
        runtime/mgc.go:1779 +0x96

goroutine 263 gp=0xc00035d880 m=nil [chan receive]:
runtime.gopark(0x8c6c560?, 0xc000f877c0?, 0xa8?, 0x7f?, 0x40c019?)
        runtime/proc.go:424 +0xce fp=0xc001087f18 sp=0xc001087ef8 pc=0x31828e
runtime.chanrecv(0xc0012a4d20, 0x0, 0x1)
        runtime/chan.go:639 +0x41e fp=0xc001087f90 sp=0xc001087f18 pc=0x2ab11e
runtime.chanrecv1(0xc000d7f1d0?, 0x0?)
        runtime/chan.go:489 +0x12 fp=0xc001087fb8 sp=0xc001087f90 pc=0x2aacd2
github.com/elastic/elastic-agent/internal/pkg/agent/install.backoffWithContext.func1()
        github.com/elastic/elastic-agent/internal/pkg/agent/install/uninstall.go:526 +0x2c fp=0xc001087fe0 sp=0xc001087fb8 pc=0x79f668c
runtime.goexit({})
        runtime/asm_amd64.s:1700 +0x1 fp=0xc001087fe8 sp=0xc001087fe0 pc=0x321101
created by github.com/elastic/elastic-agent/internal/pkg/agent/install.backoffWithContext in goroutine 1
        github.com/elastic/elastic-agent/internal/pkg/agent/install/uninstall.go:525 +0xa6
rax     0xc00068c000
rbx     0xa
rcx     0x400
rdx     0xc001298540
rdi     0xc00068c001
rsi     0xc000f8cae0
rbp     0x0
rsp     0xc000c7ee20
r8      0xc000f8cae0
r9      0xc000f8cae0
r10     0xc00068c000
r11     0xc00068c000
r12     0xc001310820
r13     0x0
r14     0xc0000f8000
r15     0x1fffffffffffff
rip     0x0
rflags  0x10202
cs      0x33
fs      0x53
gs      0x2b

possible related issue golang/go#67139

cc @dliappis @pazone

@pkoutsovasilis pkoutsovasilis added flaky-test Unstable or unreliable test cases. Team:Elastic-Agent Label for the Agent team labels Mar 4, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/elastic-agent (Team:Elastic-Agent)

@cmacknz
Copy link
Member

cmacknz commented Mar 4, 2025

@cmacknz
Copy link
Member

cmacknz commented Mar 4, 2025

The stack trace points into the goroutine spawned from this:

func backoffWithContext(ctx context.Context) backoff.Backoff {
ch := make(chan struct{})
bo := backoff.NewEqualJitterBackoff(ch, fleetAuditWaitInit, fleetAuditWaitMax)
go func() {
<-ctx.Done()
close(ch)
}()
return bo
}

Which in turn comes from:

jitterBackoff := backoffWithContext(ctx)
for i := 0; i < fleetAuditAttempts; i++ {
resp, err := cmd.Execute(ctx, req)
if err != nil {
var reqErr *fleetapi.ReqError
// Do not retry if it was a context error, or an error with the request.
if errors.Is(err, context.Canceled) {
return ctx.Err()
} else if errors.Is(err, fleetclient.ErrInvalidAPIKey) {
pt.Describe("API key is invalid (normal if already unenrolled), notification dropped.")
return nil
} else if errors.As(err, &reqErr) {
pt.Describe(fmt.Sprintf("notify Fleet: encountered unretryable error: %v", err))
return err
}
pt.Describe(fmt.Sprintf("notify Fleet: network error: %v (retry in %v)", err, jitterBackoff.NextWait()))
jitterBackoff.Wait()
continue
}

I wonder if all of this would go away if we rewrote with https://github.com/cenkalti/backoff which we already use elsewhere and natively understands contexts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flaky-test Unstable or unreliable test cases. Team:Elastic-Agent Label for the Agent team
Projects
None yet
Development

No branches or pull requests

3 participants