woodpecker/pipeline
Fernando Barbosa c7467b9828
fix: agent panic when node is terminated during step execution (#3331)
Fixes https://github.com/woodpecker-ci/woodpecker/issues/3330

This adds error handling on the agent's WaitStep function, on two
sections where it could encounter a `panic: runtime error: invalid
memory address or nil pointer dereference` in case it could no longer
access complete information about a specific pod.

This error was found to happen if the node in which the pod was running
was terminated during the step's execution.
spite active pipelines being executed on the node.

Now instead of a panic on the agent's logs and undefined behavior on the
UI it will display a more helpful error message on the UI.

### Additional context

We observed the bug first on v2.1.1, but tested the fix internally on
top of 2.3.0.


![image](https://github.com/woodpecker-ci/woodpecker/assets/7269710/dfbcf089-85f7-4b5d-8102-f21af95c5cda)
2024-02-05 22:46:14 +01:00
..
backend fix: agent panic when node is terminated during step execution (#3331) 2024-02-05 22:46:14 +01:00
errors Use assert for test (#3201) 2024-01-14 19:33:58 +01:00
frontend Add release event trigger (#3226) 2024-01-30 17:39:00 +01:00
rpc Use assert for test (#3201) 2024-01-14 19:33:58 +01:00
shared Fix spelling in test description (#3198) 2024-01-13 15:24:13 +01:00
error.go Use UUID instead of step name where possible (#3136) 2024-01-09 05:43:03 +01:00
error_test.go Use assert for test (#3201) 2024-01-14 19:33:58 +01:00
logger.go Remove multipart logger (#3200) 2024-01-14 10:54:02 +01:00
option.go Rename engine to backend (#2950) 2023-12-14 19:20:47 +01:00
pipeline.go Remove multipart logger (#3200) 2024-01-14 10:54:02 +01:00
tracer.go Check for correct license header (#2137) 2023-08-10 11:06:00 +02:00