Closed Bug 1751402 Opened 4 years ago Closed 4 years ago

Check if event timestamp is negative and record error instead of adding to payload

Categories

(Data Platform and Tools Graveyard :: Glean.js, defect, P1)

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: brizental, Assigned: brizental)

Details

Attachments

(1 file)

I noticed we are getting a few schema rejection errors due to negative timestamps from QML. That is happening because QML does not provide the performance.now API which is a monotonically increasing timer, so we use Date.now() which is not necessarily monotically increasing.

Ideally we should record an error when this happens instead of uploading an invalid ping which will get rejected.

Summary: Check if even timestamp is 0 and record error instead of adding to payload → Check if even timestamp is negative and record error instead of adding to payload
Summary: Check if even timestamp is negative and record error instead of adding to payload → Check if event timestamp is negative and record error instead of adding to payload
Priority: P4 → P3
Whiteboard: [telemetry:glean-js:m?]

Reminder: this might be a bug in Glean.js, please check.

Priority: P3 → P2

I investigated this a bit and I have hypothesis to what may be happening here.

  1. The events database simply sorts the timestamps, but if we receive a negative timestamp it doesn't do anything about it. Say we get events with the following timestamps: -20, 10, 0. Those would get sorted like: -20, 0, 10. Without worries about the negative timestamp.
  2. Can we get negative timestamps though? Turns out in QML we can: https://github.com/mozilla/glean.js/blob/a91dee541c8936eeab7f4118bf3cf3f8841c76eb/glean/src/core/utils.ts#L188. I remember doing that for some reason, but I can't remember why.
Assignee: nobody → brizental
Priority: P2 → P1
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Product: Data Platform and Tools → Data Platform and Tools Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: