Dart processes running forever

TL;DR: Dart-Sass processes (specifically, /opt/dart-sass/src/dart /opt/dart-sass/src/sass.snapshot --embedded calls) are persisting perpetually (AKA not terminating & releasing their resources).

Greetings, content management folks!

It seems my team has run into an interesting bug. We’d recently updated legacy Corteza Server and Corredor deployments to v2023.9.1. Post-upgrade, everything seemed to be running smoothly. However, a few days ago, there started to be a noticable slow-down. Checking the server’s running processes, we saw dozens upon dozens of Dart processes, some of them dating back to the last restart of the app. Every single one of them was the following statement:

/opt/dart-sass/src/dart /opt/dart-sass/src/sass.snapshot --embedded

and they’re all forked by corteza-server serve-api.

Any insights are appreciated.

Hi @dwlodarski

Which dart-sass version are you using and if possible could you share your style-sheets?

Thanks,
Mumbi Francis

Apologies for the delay, @Mumbi.Kinyanjui. Thank you for your response!

We’re running whatever version of dart-sass comes bundled with Corteza v2023.9.1.

EDIT:

I was able to discover the version of Dart-Sass included in our Corteza deployment: v1.69.5

I obtained it via the following command:

docker exec -it [CORTEZA CONTAINER NAME] sass --version

Respectfully,
Dan C. Wlodarski

@dwlodarski
I believe this issue will be solved by Fix the number of Dart sass transpiler instances spun up by KinyaElGrande · Pull Request #1860 · cortezaproject/corteza · GitHub.
Initially, we were spinning up the Dart Sass Transpiler three times causing heavy resources utilization, but we have optimized it to spin only once.

Thanks,
Mumbi Francis

1 Like

@Mumbi.Kinyanjui:

Thank you for your response!

So to summarize, this bug is effectively a resource leak in Corteza. Two superfluous forks of dart are getting created for each necessary dart fork. And as they weren’t necessary, they weren’t getting tracked for release upon completion of sass.snapshot.

Is this an accurate summary?

@dwlodarski
Yes, that’s spot on!

1 Like