Closed Bug 1624210 Opened 6 years ago Closed 6 years ago

[meta] Handle new java.lang.RuntimeException: Network connection errors

Categories

(Testing :: General, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: bc, Unassigned)

References

(Depends on 1 open bug)

Details

(Keywords: meta)

Bug 1622816 introduced an Android Runtime error when Geckoview detects that the network is either not present or has been lost. These errors are not currently supported by our frameworks or Treeherder. This bug is meant to track the work required to make these failures available to sheriffs so they can be properly flagged.

An example from mochitest filtered on E/Android illustrates the type of message we see.

Task XVXfH8-uRIekYj-r-5hk-g

03-20 22:53:17.185  6078  6078 E AndroidRuntime: FATAL EXCEPTION: main
03-20 22:53:17.185  6078  6078 E AndroidRuntime: Process: org.mozilla.geckoview.test, PID: 6078
03-20 22:53:17.185  6078  6078 E AndroidRuntime: java.lang.RuntimeException: Error receiving broadcast Intent { act=android.net.conn.CONNECTIVITY_CHANGE flg=0x4000010 (has extras) } in org.mozilla.geckoview.test.TestRunnerActivity$5@7c23564
03-20 22:53:17.185  6078  6078 E AndroidRuntime: 	at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$-android_app_LoadedApk$ReceiverDispatcher$Args_51417(LoadedApk.java:1308)
03-20 22:53:17.185  6078  6078 E AndroidRuntime: 	at android.app.-$Lambda$aS31cHIhRx41653CMnd4gZqshIQ.$m$7(Unknown Source:4)
03-20 22:53:17.185  6078  6078 E AndroidRuntime: 	at android.app.-$Lambda$aS31cHIhRx41653CMnd4gZqshIQ.run(Unknown Source:39)
03-20 22:53:17.185  6078  6078 E AndroidRuntime: 	at android.os.Handler.handleCallback(Handler.java:789)
03-20 22:53:17.185  6078  6078 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:98)
03-20 22:53:17.185  6078  6078 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:164)
03-20 22:53:17.185  6078  6078 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:6600)
03-20 22:53:17.185  6078  6078 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
03-20 22:53:17.185  6078  6078 E AndroidRuntime: 	at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
03-20 22:53:17.185  6078  6078 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:772)
03-20 22:53:17.185  6078  6078 E AndroidRuntime: Caused by: java.lang.RuntimeException: Network connection has been lost
03-20 22:53:17.185  6078  6078 E AndroidRuntime: 	at org.mozilla.geckoview.test.TestRunnerActivity$5.onReceive(TestRunnerActivity.java:278)
03-20 22:53:17.185  6078  6078 E AndroidRuntime: 	at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$-android_app_LoadedApk$ReceiverDispatcher$Args_51417(LoadedApk.java:1298)
03-20 22:53:17.185  6078  6078 E AndroidRuntime: 	... 9 more

The two errors that can appear are:

  • java.lang.RuntimeException: No network available
  • java.lang.RuntimeException: Network connection has been lost
Depends on: 1624211
Depends on: 1624213
Depends on: 1624215
Summary: Handle new java.lang.RuntimeException: Network connection errors → [meta] Handle new java.lang.RuntimeException: Network connection errors

Shouldn't network errors cause a crash, with a minidump and an .extra file with java_stack set?

The way it was implemented we just get the AndroidRuntime error. snorp: Thoughts?

Flags: needinfo?(snorp)

We have lot's of RuntimeExceptions in the code. We should handle them better in Bug 1624213 or do something different. Seems that they are a pretty standard means of raising errors in the Java code.

See Also: → 1622155

We don't report Java exceptions via the crash reporter, currently. We can do that in TestRunnerActivity, which should cause the crash to be detected normally.

Flags: needinfo?(snorp)

That would be great and would remove the need to fix bug 1624211 and bug 1624213. Should I just file a bug to make it so?

(In reply to Bob Clary [:bc:] from comment #5)

That would be great and would remove the need to fix bug 1624211 and bug 1624213. Should I just file a bug to make it so?

Yup, that's fine -- I'm working on a patch.

Depends on: 1624381

The new assertion was removed in Bug 1624715.

Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.