-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Getting 'sending message to a Handler on a dead thread' (dev branch) #426
Comments
It's only a warning in the logs, right? What's actually happening here is that one of ExoPlayer's loading threads is notifying the playback thread after the playback thread has exited (because you called release() on the player). This is working as intended, and the warning can be safely ignored. It's slightly unfortunate that the platform chooses to print this warning at all, since there are cases such as this one where the behavior is intentional and expected. |
Yep - it is a little bit annoying. Can the release() ask the loading threads to stop? |
We can probably suppress it in most cases; I'll take a look at doing that. It's not possible to suppress it in 100% of cases though (doing this would require the playback thread to potentially block on network reads, which violates the threading model and may lead to application ANRs). |
Great. Thanks. On Tue, May 5, 2015 at 11:41 AM, ojw28 notifications@github.com wrote:
|
Wouldn't |
I don't think any of these solutions are completely ideal. I'm inclined to do nothing, given there's no actual adverse affects to the user or application. The best long term solution would be a platform change to allow these kind of warnings to be turned off. I'll follow up internally about that (obviously it would only help in new platform releases). |
Yeah, I've seen them before, not sure why they are exposed to the user. Agreed, was just my two cents. On Thu, 20 Aug 2015 12:50 ojw28 notifications@github.com wrote:
|
Any solution for this warning ? 08-26 13:07:45.977: W/MessageQueue(3405): Handler (android.os.Handler) {422005a8} sending message to a Handler on a dead thread |
@issamux sounds like two different issues, The Handler issue is safe to ignore as stated. Its just a warning, they shouldn't really be exposed to the user. |
@chrisjenx yes, u're right ,bad link issue solved... but the handler warning message still loged in android log messages |
Still getting this warning even on Android N Beta 3. |
Please clarify why it's extremely annoying? It's not like it spams logcat at high frequency or anything. Why don't you just ignore it? |
It overloads app logs with useless information (stack) especially if you have used ExoPlayer a lot. |
To clarify, are these app specific logs, or do you mean general logcat? How are you capturing these logs? |
It overloads app specific logs with 05-26 13:41:26.035 2376-2708/com.app.package W/MessageQueue: Handler (com.google.android.exoplayer.upstream.Loader$LoadTask) {e2106a} sending message to a Handler on a dead thread |
I know what the logging looks like. I'm asking where you're getting these logs from and why you can't just ignore the message? What is the workflow you have that is disrupted? Overloading sounds like a bit of an exaggeration. The only time this message is printed is when the player is released (i.e. once per playback or similar). It's hard to argue that fixing this is more important than fixing pretty much anything that results in user visible issues. |
My app has an option to read logs from logcat and send it to me. There is a fixed log buffer size in Android. When I check logs I see these logs which sometimes can overwrite more important information. Of cause this bug is not important, but it is very annoying for those developers who check their logs. |
I don't think it's fixed size per application. I think it's fixed size shared by all applications, and given the amount of log spam other processes tend to produce the errors discussed here most likely have very minimal impact on the amount of useful logging that you're able to capture. If you believe the above to be incorrect, could you please point to the documentation that describes a per application fixed size log buffer, and also explain what method/api you're using to read the logs. |
Hi, I think this does have a problem. The message sent to the dead thread is intended to release the memory that had allocated. And I toggled many times between prepare and release, each time this warning occurs, the memory is accumulating without releasing. |
@Bidp - This is correct, but it's only a problem if you try and re-use an We've fixed this issue in ExoPlayer 2.x (not yet available on GitHub). We have no plans to backport the change to 1.x. |
@ojw28 Thank you. Your reply solves my problem. Looking forward to ExoPlayer 2.x. Good job, guys. |
This removes "message sent on dead thread" warnings in nearly all cases, and guarantees delivery of load cancelation to event listeners. Issue: #426 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=123957691
This is fixed in the 2.x.x experimental branch. |
Fixed in |
the application sends a message to the Handler that has exited |
When performing the following call from the UI main thread:
exoPlayer.blockingSendMessage(videoRenderer, MediaCodecVideoTrackRenderer.MSG_SET_SURFACE, null);
I randomly get the following exception:
05-03 13:41:39.468 23310-25973/me.samba.app W/MessageQueue﹕ Handler (com.google.android.exoplayer.upstream.Loader$LoadTask) {44fe3a10} sending message to a Handler on a dead thread
java.lang.RuntimeException: Handler (com.google.android.exoplayer.upstream.Loader$LoadTask) {44fe3a10} sending message to a Handler on a dead thread
at android.os.MessageQueue.enqueueMessage(MessageQueue.java:320)
at android.os.Handler.enqueueMessage(Handler.java:626)
at android.os.Handler.sendMessageAtTime(Handler.java:595)
at android.os.Handler.sendMessageDelayed(Handler.java:566)
at android.os.Handler.sendEmptyMessageDelayed(Handler.java:530)
at android.os.Handler.sendEmptyMessage(Handler.java:515)
at com.google.android.exoplayer.upstream.Loader$LoadTask.run(Loader.java:249)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
What am I doing wrong?
The text was updated successfully, but these errors were encountered: