# Gatling does not stop

**URL:** <https://community.gatling.io/t/gatling-does-not-stop/4224>\
**Category:** Gatling (Open-Source)\
**Created:** [March 13, 2018, 2:35pm UTC](https://community.gatling.io/t/gatling-does-not-stop/4224 "2018-03-13T14:35:41Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bene\_Csaba](https://avatars.discourse-cdn.com/v4/letter/b/85e7bf/32.png) [@Bene\_Csaba](https://community.gatling.io/u/Bene_Csaba)\
**Post date:** [March 13, 2018, 2:35pm UTC](https://community.gatling.io/t/gatling-does-not-stop/4224/1 "2018-03-13T14:35:41Z")

</div>

After executing some requests gatling starts to do this :

---

<div class="post-metadata">

**Author:** ![slandelle](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/slandelle/32/4_2.png) [@slandelle](https://community.gatling.io/u/slandelle)\
**Post date:** [March 13, 2018, 2:37pm UTC](https://community.gatling.io/t/gatling-does-not-stop/4224/2 "2018-03-13T14:37:15Z")

</div>

Which version of Gatling do you use?  
Can you please provide a sample that reproduces your problem?

---

<div class="post-metadata">

**Author:** ![Bene\_Csaba](https://avatars.discourse-cdn.com/v4/letter/b/85e7bf/32.png) [@Bene\_Csaba](https://community.gatling.io/u/Bene_Csaba)\
**Post date:** [March 13, 2018, 2:54pm UTC](https://community.gatling.io/t/gatling-does-not-stop/4224/3 "2018-03-13T14:54:10Z")

</div>

I am using the one available in maven , 2.3.1

It is a standard code, which works on localhost :

class DemoTest extends Simulation {  
/\*\*  
I use this to control the logic  
\*/  
val init=new DemoTestInitializer()

/\*\*

- main protocol to use : url is get from parameters  
\*/  
val httpProtocol = http  
.baseURL(init.getMainUrl())  
.inferHtmlResources(BlackList(), WhiteList())  
.acceptEncodingHeader(“gzip,deflate”)  
.contentTypeHeader(“text/xml;charset=UTF-8”)  
.userAgentHeader(“Apache-HttpClient/4.1.1 (java 1.5)”)  
.disableAutoReferer

val feederCasa = Iterator.continually(Map( “vin” → init.getCasaVin(), “dest”-\> “CASA”,  
“gcid”-\>init.getCasaGcid(), “fail”-\>init.getFailOver() ))

val feederBip = Iterator.continually(Map( “vin” → init.getBipVin(), “dest”-\> “BIP”,  
“gcid”-\>init.getBipGcid(), “fail”-\>init.getFailOver() ))

object DemoRequest {

val vehicleV1 = http(“vehicleV1-${dest}-${fail}”).get("/restForward/vehicle/v1/${vin}").header(“X-rgw-gcid”,"${gcid}")

…  
}

val retrieveVehicleScenario = scenario(“retrieveVehicleScenario”).exec(  
doIf(session=\>testName==“retrieve”)(  
asLongAs(session=\>init.hasStopped()\>0) {  
feed(feeder).exec(DemoRequest.retrieve)  
}  
)  
)  
val retrieveVehicleBipScenario = scenario(“retrieveVehicleBipScenario”).exec(  
doIf(session=\>testName==“retrieve”)(  
asLongAs(session=\>init.hasStopped()\>0) {  
feed(feederBip).exec(DemoRequest.retrieve)  
}  
)  
)

setUp(  
vehicleScenarioBip.inject(atOnceUsers(50)),  
vehicleScenarioCasa.inject(atOnceUsers(50))

).protocols(httpProtocol)

I not the part where is sending requests is failing, but after I hang the server (adding delay 60000)

And I have seen this behavior on other errors as well.  
I am using my own creation and control mechanism from java, which works fine, when this is not hanged.

The code in “hasStopped” is not called when this behaviour is in place.

Can I at least see what the hell is gatling waiting for ?

---

<div class="post-metadata">

**Author:** ![Bene\_Csaba](https://avatars.discourse-cdn.com/v4/letter/b/85e7bf/32.png) [@Bene\_Csaba](https://community.gatling.io/u/Bene_Csaba)\
**Post date:** [March 13, 2018, 2:58pm UTC](https://community.gatling.io/t/gatling-does-not-stop/4224/4 "2018-03-13T14:58:23Z")

</div>

It can not be reproduced, it appears on one server, does not on the other.  
I need to limit the time waiting in Gatling after the last sent request, that’s what I am asking how to do.  
So if let’s say last request in Gatling was sent 180 sec ago, I need Gatling to stop and generate the request,  
considering all pending requests timeout.

---

<div class="post-metadata">

**Author:** ![Bene\_Csaba](https://avatars.discourse-cdn.com/v4/letter/b/85e7bf/32.png) [@Bene\_Csaba](https://community.gatling.io/u/Bene_Csaba)\
**Post date:** [March 13, 2018, 3:09pm UTC](https://community.gatling.io/t/gatling-does-not-stop/4224/5 "2018-03-13T15:09:27Z")

</div>

**This is how it starts :**

**HTTP request:**  
**GET https:///restForward/vehicle/v1/LOADTEST\_CAS\_0082**  
**headers=**  
**Accept-Encoding: gzip,deflate**  
**Content-Type: text/xml;charset=UTF-8**  
**User-Agent: Apache-HttpClient/4.1.1 (java 1.5)**  
**X-rgw-gcid: d2e86e2d-be4b-4ad8-a8bf-6244a413a936**  
**Cookie: 556fd0526b082be5ae4e742734fb3196=5ddcfe36801faffa9e4c3b804e58ae39; bec442e9e0d74bbc8434823639ded6d1=a038fd0c4f929c569c6e50d6089c4174**  
**Host:**   
**Accept: _/_**

---

<div class="post-metadata">

**Author:** ![slandelle](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/slandelle/32/4_2.png) [@slandelle](https://community.gatling.io/u/slandelle)\
**Post date:** [March 13, 2018, 3:19pm UTC](https://community.gatling.io/t/gatling-does-not-stop/4224/6 "2018-03-13T15:19:08Z")

</div>

This could be a bug. In this case, it’s impossible to investigate and fix without getting our hands on a way to reproduce on our side.

---

<div class="post-metadata">

**Author:** ![Bene\_Csaba](https://avatars.discourse-cdn.com/v4/letter/b/85e7bf/32.png) [@Bene\_Csaba](https://community.gatling.io/u/Bene_Csaba)\
**Post date:** [March 13, 2018, 3:45pm UTC](https://community.gatling.io/t/gatling-does-not-stop/4224/7 "2018-03-13T15:45:22Z")

</div>

Gatling has no option to limit the wait time, after the last request sent ?  
http.ahc.readTimeout ?  
ttp.ahc.webSocketTimeout ?

timeOut.simulation ?
