how to terminate active sessions

Hello,

Can somebody please advise on best practice to kill active season ? We have SDK load test use-case where Gatling session doesn’t exit on exception (we have tried ExitHereIfFailed at al DSL constructs- that doesnt work).
active users keep hogging memory leading to uncontrolled memory growth of gatling process

.exec(session => {
//java SDK call here, which can throw exception
//need this call chain to exit in case of exception session
})

typo

Hello,

Can somebody please advise on best practice to kill active session ? We have SDK load test use-case where Gatling session doesn’t exit on exception (we have tried ExitHereIfFailed at al DSL constructs- that doesnt work).
active users keep hogging memory leading to uncontrolled memory growth of gatling process

  • |

// kill this user session if exception or error in this bloc, exithereIfFailed does not work, need to explicitly kill it

Works just fine for me:

val scn = scenario("Crash")
  .exec { session =>
    if (true) throw new Exception("Hello")
    session
  }
  .exitHereIfFailed
  .exec { session =>
    if (true) throw new Exception("Shouldn't be here")
    session
  }