mercedes-benz / sechub

SecHub provides a central API to test software with different security tools.
https://mercedes-benz.github.io/sechub/
MIT License
258 stars 58 forks source link

Soft SecHub job restart does not work #3189

Closed winzj closed 3 weeks ago

winzj commented 3 weeks ago

Situation

The implementation inside SchedulerRestartJobService does purge the existing product results when it is a hard restart. In this case the restart implementation works as expected.

We wanted to use the soft restart mechanism for #390 to provide the RESUME workflow for a PAUSED job in #390 , means:

New server starts Next fetched job is a PAUSED one, so we would trigger here automatically a soft restart and all should work out of the box.

Problem

Inside PDSAdapterV1 we write the PDS_JOB_UUID into the meta data via callback (from product executor) which stores it inside the product result. So far so good, but the information for the executor configuration is not stored.

When it comes to soft restart inside ScanJobExecutionRunnable, the steps there for the product executors (prepare, analysis, code scan etc.) currently always trigger a new PDS job - even when there are running PDS jobs!

Wanted

winzj commented 3 weeks ago

Was a mistake it's not a bug - it is already implemented. The product executor configuration uuid is already stored inside COLUMN_PRODUCT_CONFIG_UUID at ProductResult entity in database and is used when fetching the current product result by ProductExecutorCallbackImpl#getProductResult() which is used by adapters...

The former results are loaded from database by AbstractProductExecutionService#runOnExecutorWithOneConfiguration()