[CI] Log error on fast-async-transform failure (#191012)

## Summary
A missed catch+log during the fast transformation of typescript files to
js files caused the task pooling library, `piscina` to terminate without
a warning. The terminated workers would crash with unexpected messages,
and that resulted in original errors to be lost, and misleading error
messages. This PR adds some logging.

See:
https://buildkite.com/elastic/kibana-pull-request/builds/228663#019170d4-4f00-4ccc-915e-7d8b0a6ca020
- the original causes were incorrect `await` usages, but that was never
revealed, because we only got the messages that arrived to a terminated
worker.

See also, for more background:
https://elastic.slack.com/archives/C5UDAFZQU/p1724236149083029
This commit is contained in:
Alex Szabo 2024-08-21 20:59:33 +02:00 committed by GitHub
parent 748326d1e2
commit be2f7f414d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -39,6 +39,8 @@ async function withFastAsyncTransform(config, block) {
try {
await block(transform);
success = true;
} catch (e) {
console.error('Error during transformation', e);
} finally {
try {
await pool.destroy();