android restarter spins for ever waiting for fennec to die

RESOLVED FIXED

Status

()

Core
Widget: Android
RESOLVED FIXED
8 years ago
8 years ago

People

(Reporter: blassey, Assigned: blassey)

Tracking

Trunk
All
Android
Points:
---

Firefox Tracking Flags

(fennec2.0b2+)

Details

Attachments

(1 attachment)

this causes a black screen and eventually an OS message saying "org.mozilla.fennec" has stopped responding.
(Assignee)

Updated

8 years ago
tracking-fennec: --- → ?
(Assignee)

Updated

8 years ago
tracking-fennec: ? → 2.0b2+
(Assignee)

Updated

8 years ago
Duplicate of this bug: 607388
Assignee: nobody → blassey.bugs
Created attachment 486120 [details] [diff] [review]
patch

It looks like the broadcast receiver is keeping our process alive. This wasn't happening yesterday when I landed the follow up to bug 606178, not sure what changed.

This patch makes the Restarter an activity so we can use the FLAG_ACTIVITY_NEW_TASK safely on eclair and make sure it gets launched into a different process. It also puts a count down into the loop so we won't spin infinitely if something goes wrong. We might want to add some fallback code that tries to kill the hung process if we hit this in the future.
Attachment #486120 - Flags: review?(mwu)

Comment 3

8 years ago
Comment on attachment 486120 [details] [diff] [review]
patch

Can we just go back to System.exit() like we were doing before?
There's a bit of nuance here, but no, not unless we go back to the Runtime.exed("am start ....") approach. That basically spawned a new process for use right away, we exited our original process then the broadcast receiver stared yet another process. With the sendBroadcast, as far as I can tell, System.exit(0) will either kill the process before the broadcast is received or kill the process that the broadcast receiver is running in, depending on how the race goes.

Comment 5

8 years ago
Comment on attachment 486120 [details] [diff] [review]
patch

I think using a separate activity to achieve the restart is more correct anyway.
Attachment #486120 - Flags: review?(mwu) → review+
OS: Linux → Android
Hardware: x86_64 → All
pushed http://hg.mozilla.org/mozilla-central/rev/1d6473fff774
Status: NEW → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.