lockable-resources-plugin icon indicating copy to clipboard operation
lockable-resources-plugin copied to clipboard

standard exception handling altered in a lock context

Open AlexanderStohr opened this issue 1 year ago • 3 comments

Jenkins and plugins versions report

for my test cases i found/assume that when i am inside a lock the standard exception handling is replace by the lock call. thus where i formerly might have seen some error message and a hint for the exact line of trouble (or even a stack trace) i am now getting only outputs that do hint for the lock being returned - and a "FAILED" error is reported at the very end of my pipeline.

also i feel that cases where the lock fails (e.g. empty string passed to the label: parameter; or no such label found...) there is no good chance to locate and tell about the failure of lock-reservation - no such messages, just an overall failure.

What Operating System are you using (both controller, and any agents involved in the problem)?

Jenkins 2.346.3 on Linux lock plugin 2.18

Reproduction steps

setup a pipeline use the lock() { ... } command raise failures, such as empty label, non-registered label, an exception in the clamped block...

Expected Results

sufficient outputs to know about the error in the enclosed block

sufficient outputs when the lock itself failed for whatever reason

Actual Results

the lock function call just silently fails and terminates the build - also hiding all other failures that lead to the error state.

Anything else?

No response

AlexanderStohr avatar Mar 29 '23 12:03 AlexanderStohr

@AlexanderStohr can you confirm this issue also in the latest released plugin version? 2.18 version is pretty old one.

mPokornyETM avatar Apr 14 '23 07:04 mPokornyETM

i don't have a matching runtime handy.

AlexanderStohr avatar Apr 14 '23 22:04 AlexanderStohr

Ok, I will try it.

mPokornyETM avatar Apr 16 '23 20:04 mPokornyETM