Search code examples
multithreadingjmeterdeadlock

JMeter Critical Section Controller dead lock


About Critical Section Controller:

The Critical Section Controller ensures that its children elements (samplers/controllers, etc.) will be executed by only one thread as a named lock will be taken before executing children of controller.

It's not that hard to create a dead lock and make JMeter stuck If inside lock A add lock B and inside other lock B add lock A with a few threads there's a dead lock:

Can this be avoided ? and if not can there be a warning for users using this controller ?


Solution

  • Yes indeed using, the way you show it can lead to Java Dead Lock as it's the equivalent of a "synchronized" block in Java.

    As JMeter provides a kind of algorithmic way to develop a test, this looks regular to me.

    You can potentially raise an enhancement request for detection of Dead lock or provide a PR improving documentation.

    I think project will be happy to merge it.