# gRPC StatusCode.RESOURCE\_EXHAUSTED

**URL:** <https://forum.robotframework.org/t/grpc-statuscode-resource-exhausted/4082>\
**Category:** Browser\
**Created:** [27 June 2022 12:53 UTC](https://forum.robotframework.org/t/grpc-statuscode-resource-exhausted/4082 "2022-06-27T12:53:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomaspekarovic](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/tomaspekarovic/32/1368_2.png) [@tomaspekarovic](https://forum.robotframework.org/u/tomaspekarovic)\
**Post date:** [27 June 2022 12:53 UTC](https://forum.robotframework.org/t/grpc-statuscode-resource-exhausted/4082/1 "2022-06-27T12:53:24Z")

</div>

Hi all,

i have problem with running playwright (browser) tests against the selenium-grid4

From time to time, I have to wait for request to be finished and it takes about 1.5min - 2min,

So I’m using `Wait For Element State <element> detached 2min`  
But there is about 50/50 chance, that I get: `StatusCode.RESOURCE_EXHAUSTED`

I found out that this resouce have limit of 4kb. It looks like, that this long sleeps can exceed this limit and it just kills chrome , and close playwright execution.

Is there any chance how to fix this, or increase this limit to handle this long waits?

---

<div class="post-metadata">

**Author:** ![aaltat](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/aaltat/32/15_2.png) [@aaltat](https://forum.robotframework.org/u/aaltat)\
**Post date:** [28 June 2022 13:00 UTC](https://forum.robotframework.org/t/grpc-statuscode-resource-exhausted/4082/2 "2022-06-28T13:00:16Z")

</div>

Would it be possible to see full stack trace and also see playwright debug logs also, when the error happens.

---

<div class="post-metadata">

**Author:** ![tomaspekarovic](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/tomaspekarovic/32/1368_2.png) [@tomaspekarovic](https://forum.robotframework.org/u/tomaspekarovic)\
**Post date:** [28 June 2022 16:04 UTC](https://forum.robotframework.org/t/grpc-statuscode-resource-exhausted/4082/3 "2022-06-28T16:04:05Z")

</div>

I found it out. It was totally my fault.  
I’m running tests agains selenium grid 4. So I have HUB + NODE…

BUT, when playwright/browser is run against that hub… the hub just ‘replies’ to playwraith that… here you are, here is the free node to run against… Playwright is then just connected to that node.

The problem is, that grid nor node does not know, that I’m running tests…

By default the session-timeout on the node is set to 300s… So the problem was that if tests lasts longer than 300s, chromeNode just kills the chrome browser, because it is ‘idle for 300s’ (even thou the tests are running). Afterwards, the ‘RESOURCE\_EXHAUSTED’ error is raised.

So the solution was to just set session-timeout to 900s , that handles all the cases that can happen

It is kind of strange, but I found this as only solution

---

<div class="post-metadata">

**Author:** ![aaltat](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/aaltat/32/15_2.png) [@aaltat](https://forum.robotframework.org/u/aaltat)\
**Post date:** [14 July 2022 06:36 UTC](https://forum.robotframework.org/t/grpc-statuscode-resource-exhausted/4082/4 "2022-07-14T06:36:40Z")

</div>

Interesting, in Selenium side resource is also released explicitly. Perhaps this is something to report in Playwright side and hopefully enhance.
