Bug 1994757 - Store the client ID in an additional plaintext file and report on regeneration#3292
Bug 1994757 - Store the client ID in an additional plaintext file and report on regeneration#3292
Conversation
333e836 to
8e10346
Compare
8e10346 to
e2931ad
Compare
travis79
left a comment
There was a problem hiding this comment.
Nothing concerning here, r+ from me pending data-review
|
Oh, and also needs docs |
c39f7ea to
7405896
Compare
| glean | ||
| .core_metrics | ||
| .client_id | ||
| .set_from_uuid_sync(&glean, stored_client_id); |
There was a problem hiding this comment.
Would this be considered a "mitigation" that we should avoid until later?
There was a problem hiding this comment.
So I guess technically?
But let's think through it:
- We assume a client right now can contain a c0ffee ID
- We also assume no
client_id.txtexists. - Glean inits, writes the client ID (
c0ffee) from the DB into the file. - Glean initializes core metrics. Detects
c0ffeein the database. Generates a new UUID. Stores that into the database and the file.
If for whatever reason (4) doesn't happen, the file will also include the c0ffee ID.
So "restoring" means we don't change anything.
If (4) happens, both the database and the file should have the same, valid ID (except if it happens to crash right in between these two operations, which I guess ... at our scale could happen?). So maybe we should check that stored_client_id is not the c0ffee ID either? It's a tiny edge case, but I had enough with our edge cases 🙈
In a test then ensure the additional uploader thread is not launched
chutten
left a comment
There was a problem hiding this comment.
I can't think of any way to make this better, well done
33c0f20 to
2ff3401
Compare
This is a first approach at putting this state diagram into code.
This is not yet pretty. or organized. or ready to be looked at.
But it's not not wrong and I will expand upon that.