We've observed a problem on our Moodle 3.11.1 environments on AWS EC2 in which the \core\task\build_installed_themes_task doesn't finish and eventually (after days or weeks) consumes available memory, causing an outage. Debugging suggests that the CSS parsing task fails on the RTL CSS generation on both classic and boost. Sample output:
[ec2-user@ip-X-X-X-X public]$ sudo -u apache /bin/php admin/cli/build_theme_css.php --verbose --themes=classic
== Build theme css ==
Checking that each theme is correctly installed...
Building CSS for themes: classic
Building theme CSS for classic [ltr] ... done in 3.21 seconds.
Building theme CSS for classic [rtl] ...
It doesn't finish nor does it time out. We run our production environment with an autoscaling group of t3.medium EC2 instances (2 cores, 4 GB of memory). We have few if any users using RTL so there's no observable production impact until the Moodle environments run out of memory.