glide
glide copied to clipboard
Proof of concept for investigation of "Cannot recycle a resource while it is still acquired"
Description
Trace asynchronous calls across Handler messages. It's probably not acceptable in its current form due to many allocations. I wonder how this could make it to production. Is there a way to "debug" Glide? Feature flag?
Motivation and Context
https://github.com/bumptech/glide/issues/4507 and https://github.com/bumptech/glide/issues/5211 have no idea why it's happening, this would highlight which part of the app is causing the issue.
It could be done with a default off log tag that's checked once statically? You could avoid capturing the stack trace unless it's enabled.
I think a Log tag is not enough, they need to deploy it to production so that they can get crash traces from real devices. And they can't execute adb shell setprop there. It's not reproducible in dev envs as I understood. Glide users need to control this explicitly to opt in.
Although a simple static boolean variable would work, I guess.
Hmm for production use cases we could use the flags system, might be annoying to pipe it through, but once done you can read from some set of flag values during initialization to control this: https://github.com/bumptech/glide/blob/75599b7af05eeca1393c8f4267adb78e88e7821e/library/src/main/java/com/bumptech/glide/GlideBuilder.java#L452