For future reference:
I just had to troubleshoot a script that ran so long that it eventually died without any relevant errors ([pid 6048:tid 139809649469184] (104)Connection reset by peer: [client 184.4.89.70:0] FastCGI: comm with server "/var/run/a49982b9-remi-safe-php81.fcgi" aborted: read failed, referer
was getting written to the Apache error logs).
Thankfully I was able to reproduce the issue locally. Here are the steps I took in Warden to troubleshoot:
In pub/index.php
I added this line: set_time_limit(15);
above the $bootstrap->run($app);
cd <PATH TO MAGENTO 2 DIRECTORY>