I do not believe this error is related to the recursive query. This is a technical problem. Check your settings and status of the instances.
You may have a group of Nodes with limited resources. And at the same time you’re doing the recursive query Dgraph maybe is doing other routine activities. And this can lead to some connection problem. But this is an assumption of a hypothetical situation, as I do not know the details of its context.
This is possible, but it is not controllable. You will not always have a desired result.
Ideally, paging should take place in Root in that case. If you use paging in the body of the recursive query it can get very confusing and out of control. Paging does not quite mix with recursive query.
In fact the example in https://docs.dgraph.io/query-language/#recurse-query is already using pagination - “first:”.
The idea here is to obey Root’s rule and use other combinations in https://docs.dgraph.io/query-language/#pagination