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

On Download, serialized data passed to the Worker exceedes the max size allowed (Solution: only pass songId instead of full object) #24

Closed
lachlan-00 opened this issue Jan 31, 2024 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@lachlan-00
Copy link

I think this one would be limiting the length of the url. Which is good because 3300 song ids would definitely be too long to send

Screenshot_20240131_171322_ConnectBot.jpg

@icefields
Copy link
Owner

what caused this issue exactly? Would be great if I could reproduce it.

@icefields
Copy link
Owner

Beside the steps, I also need to know what happens next.
Does the app crash? Does it skip one download and finished the others or the download process is completely stopped? I created a playlist of 41k songs and started downloading, I didn't experience this bug (so far, still downloading), any help fixing this issue is appreciated.

@lachlan-00
Copy link
Author

Looks fixed from 0.08 onwards

@icefields
Copy link
Owner

I'm going to reopen this, from the crash trace I received yesterday night looks like it's still happening silently and that's what causing issues with downloads, at least from what I see in the logs.
Anyway, the bug is not with the url, it's with the serialized "Song" object I pass from the download-worker to the main thread, apparently some times that object exceeds the max size allowed for passing object between threads.
I will implement a fix today, I'm going to pass the songId only instead of the full object, the worker can then retrieve the song object by itself instead of passing big serialized objects around.

"java.lang.IllegalStateException: Data cannot occupy more than 10240 bytes when serialized\n\tat androidx.work.Data.toByteArrayInternal(Data.java:404)\n\tat androidx.work.Data$Builder.build(Data.java:941)\n\tat androidx.work.OverwritingInputMerger.merge(OverwritingInputMerger.kt:32)\n\tat androidx.work.impl.WorkerWrapper.runWorker(WorkerWrapper.java:224)\n\tat androidx.work.impl.WorkerWrapper.run(WorkerWrapper.java:144)\n\tat androidx.work.impl.utils.SerialExecutorImpl$Task.run(SerialExecutorImpl.java:96)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)\n\tat java.lang.Thread.run(Thread.java:1012)\n"



@icefields icefields reopened this Feb 1, 2024
@icefields icefields added the bug Something isn't working label Feb 1, 2024
@lachlan-00
Copy link
Author

I see downloads are not crashing the app but some songs will not download and stop the process.

I've tested a few times on my lists. 4-8 songs usually and then a stop. Could that error be a cause too?

Will this error show up on Android studio if i load in there?

@icefields
Copy link
Owner

That issue should have been fixed on 0.10-beta. If you're on that version then the problem doesn't seem to be solved, and I'll look into it again.
Make sure you're on 0.10-beta , the other day I released 3 versions in a day, very easy lo lose track.

The log won't who show if you connect to android studio because the exception is caught without outputting any log on production releases. But you could go to Settings and enable remote logging and I will get a log of the exception.

@lachlan-00
Copy link
Author

lachlan-00 commented Feb 4, 2024

cool, i've done that, that will save me having to ask a lot more questions

for the download it actually looks like its working as i get a log for it each attempts to download
image

the url shows up in access logs and will download in a browser. maybe the anon logs will show more.

Refreshed the list to get a new list of songs and the download restarts. so it seems to stick on random songs for some reason

@icefields icefields changed the title Url limit on download On Download, serialized data passed to the Worker exceedes the max size allowed (Solution: only pass songId instead of full object) Feb 14, 2024
@icefields icefields self-assigned this Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants