Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug - Android rounded icon generation hangs indefinitely #521

Open
dobripet opened this issue May 17, 2023 · 1 comment
Open

Bug - Android rounded icon generation hangs indefinitely #521

dobripet opened this issue May 17, 2023 · 1 comment

Comments

@dobripet
Copy link

dobripet commented May 17, 2023

Hi,
we are facing following issue in our CI server.
When building android assets it gets stuck when composing round icons and awaits for half of them never finish.
To get it working I had to set environment variable UV_THREADPOOL_SIZE to 1. This might be just issue for sharp itself or maybe newer version of sharp works, no idea.

I added some debugging logs to the android platform index file as following.

image

And this is the output:

09:16:11   Android basic icons collected.
09:16:11   Android rounded icon started: ldpi
09:16:11   Sharp queue contains 1 task(s)
09:16:11   Android rounded icon started: mdpi
09:16:11   Sharp queue contains 2 task(s)
09:16:11   Android rounded icon started: hdpi
09:16:11   Sharp queue contains 3 task(s)
09:16:11   Android rounded icon started: xhdpi
09:16:11   Sharp queue contains 4 task(s)
09:16:11   Android rounded icon started: xxhdpi
09:16:11   Sharp queue contains 5 task(s)
09:16:11   Android rounded icon started: xxxhdpi
09:16:11   Sharp queue contains 6 task(s)
09:16:11   Sharp queue contains 6 task(s)
09:16:11   Sharp queue contains 2 task(s)
09:16:11   Sharp queue contains 1 task(s)
09:16:11   Android rounded icon resized: \android\app\src\main\res\mipmap-ldpi\ic_launcher_round.png sharp concurrency: 4 sharp counters: { queue: 1, process: 4 }
09:16:11   Sharp queue contains 1 task(s)
09:16:11   Sharp queue contains 0 task(s)
09:16:11   Android rounded icon resized: \android\app\src\main\res\mipmap-mdpi\ic_launcher_round.png sharp concurrency: 4 sharp counters: { queue: 0, process: 5 }
09:16:11   Sharp queue contains 1 task(s)
09:16:11   Sharp queue contains 1 task(s)
09:16:11   Android rounded icon resized: \android\app\src\main\res\mipmap-hdpi\ic_launcher_round.png sharp concurrency: 4 sharp counters: { queue: 1, process: 4 }
09:16:11   Sharp queue contains 2 task(s)
09:16:11   Sharp queue contains 1 task(s)
09:16:11   Android rounded icon resized: \android\app\src\main\res\mipmap-xhdpi\ic_launcher_round.png sharp concurrency: 4 sharp counters: { queue: 1, process: 4 }
09:16:11   Sharp queue contains 2 task(s)
09:16:11   Sharp queue contains 1 task(s)
09:16:11   Android rounded icon resized: \android\app\src\main\res\mipmap-xxxhdpi\ic_launcher_round.png sharp concurrency: 4 sharp counters: { queue: 1, process: 4 }
09:16:11   Sharp queue contains 2 task(s)
09:16:11   Sharp queue contains 2 task(s)
09:16:11   Android rounded icon resized: \android\app\src\main\res\mipmap-xxhdpi\ic_launcher_round.png sharp concurrency: 4 sharp counters: { queue: 1, process: 4 }
09:16:11   Sharp queue contains 2 task(s)
09:16:11   Sharp queue contains 0 task(s)
09:16:11   Android rounded icon composited: \android\app\src\main\res\mipmap-mdpi\ic_launcher_round.png sharp concurrency: 4 sharp counters: { queue: 0, process: 5 }
09:16:11   Sharp queue contains 1 task(s)
09:16:11   Sharp queue contains 0 task(s)
09:16:11   Android rounded icon composited: \android\app\src\main\res\mipmap-xxxhdpi\ic_launcher_round.png sharp concurrency: 4 sharp counters: { queue: 0, process: 5 }
09:16:11   Sharp queue contains 1 task(s)
09:16:11   Sharp queue contains 1 task(s)
09:16:11   Android rounded icon composited: \android\app\src\main\res\mipmap-xxhdpi\ic_launcher_round.png sharp concurrency: 4 sharp counters: { queue: 1, process: 4 }
09:16:11   Sharp queue contains 2 task(s)
09:16:11   Sharp queue contains 0 task(s)
09:16:11   Android rounded icon outputted: \android\app\src\main\res\mipmap-mdpi\ic_launcher_round.png sharp concurrency: 4 sharp counters: { queue: 0, process: 5 }
09:16:11   Android rounded icon finished: mdpi
09:16:11   Sharp queue contains 0 task(s)
09:16:11   Android rounded icon outputted: \android\app\src\main\res\mipmap-xxxhdpi\ic_launcher_round.png sharp concurrency: 4 sharp counters: { queue: 0, process: 4 }
09:16:11   Android rounded icon finished: xxxhdpi
09:16:11   Sharp queue contains 0 task(s)
09:16:11   Android rounded icon outputted: \android\app\src\main\res\mipmap-xxhdpi\ic_launcher_round.png sharp concurrency: 4 sharp counters: { queue: 0, process: 3 }
09:16:11   Android rounded icon finished: xxhdpi

And after last logged line process will hang forever till killed.

Also instead of awaiting Promise.All for rounded icons I tried to generate them sequentially in for loop and awaiting individual icons and it worked as well so there is probably something wrong with parallel composition / threading.

Sometimes (rarely) it got stucked even on my local environment which is more powerful and where I got sharp concurrency 12.

Thank you for any feedback.

@bharath-sampath
Copy link

Facing the same issue in local from my end as well. I am yet to integrate with the CI server. Thank you for the above workaround. Will try it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants