How do I implement a simulation with concurrent request retries?

Hi there,

I am looking for advice on how to simulate a client that has slightly weird concurrent retry behaviour :

  • it’s been X seconds since a request was sent and we have received no response

  • we do not want to terminate the existing request (in case it returns before a retry)

  • we send the request again, concurrently with the existing request (so there are now two requests in flight)

  • we want to retry in X second intervals until we get a response from one of our requests or we exceed retryLimit

  • if we receive a response from any of the in-flight requests, we don’t send any more retries

The closest I’ve got so far was to configure the request/connection timeout parameters and with code looking a bit like this:

`
tryMax(retryLimit) {
exec(actionBuilder)
}

`



The problem with this is that:

- there's only a single request in flight at a time
- having connection/request timeouts configured guarantees that I will never see the response for a request that took more than X seconds

Is there a way to model this in Gatling? I would really appreciate any ideas or advice from the community.

Cheers!