Closed Bug 808750 Opened 12 years ago Closed 12 years ago

More logging and safety in resource callbacks

Categories

(Firefox :: Sync, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla19

People

(Reporter: rnewman, Assigned: rnewman)

References

Details

(Whiteboard: [qa-])

Attachments

(1 file)

We're seeing some odd failures, so time for more catches and logs.
This makes every channel callback in Resource ridiculously paranoid about throwing. See blocked bug for why.
Attachment #678524 - Flags: review?(gps)
Comment on attachment 678524 [details] [diff] [review]
Ridiculously paranoid. v1

Review of attachment 678524 [details] [diff] [review]:
-----------------------------------------------------------------

Necessary evil.

::: services/sync/modules/resource.js
@@ +513,5 @@
> +    try {
> +      siStream = Cc["@mozilla.org/scriptableinputstream;1"].createInstance(Ci.nsIScriptableInputStream);
> +      siStream.init(stream);
> +    } catch (ex) {
> +      this._log.warn("Exception creating nsIScriptableInputStream." + Utils.exceptionStr(ex));

CommonUtils

@@ +514,5 @@
> +      siStream = Cc["@mozilla.org/scriptableinputstream;1"].createInstance(Ci.nsIScriptableInputStream);
> +      siStream.init(stream);
> +    } catch (ex) {
> +      this._log.warn("Exception creating nsIScriptableInputStream." + Utils.exceptionStr(ex));
> +      this._log.debug("Parameters: " + req.URI.spec + ", " + stream + ", " + off + ", " + count);

Assuming req.URI is defined. How paranoid do you want to be? ;)
Attachment #678524 - Flags: review?(gps) → review+
(In reply to Gregory Szorc [:gps] from comment #2)

> CommonUtils

Damn qref.

> Assuming req.URI is defined. How paranoid do you want to be? ;)

At that point we'll have already logged _something_; an exception in that particular line would be apparent due to its absence. I do check for that in the redirect handler! :D
Interestingly, I just noticed a bunch of other Utils.*:

      // Got a response, but an exception occurred during processing.
      // This shouldn't occur.
      this._log.warn("Caught unexpected exception " + Utils.exceptionStr(ex) +
                     " in _onComplete.");


Gonna fix those, too.
https://hg.mozilla.org/services/services-central/rev/7c861ef4f235

… with extensions.
Whiteboard: [fixed in services][qa-]
Blocks: 805386
No longer blocks: 806386
https://hg.mozilla.org/mozilla-central/rev/7c861ef4f235
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Whiteboard: [fixed in services][qa-] → [qa-]
Target Milestone: --- → mozilla19
Component: Firefox Sync: Backend → Sync
Product: Cloud Services → Firefox
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: