findAnnotations can return {id: null} #2829

Closed
opened 2015-09-08 07:41:09 +00:00 by wjt · 2 comments

Annotation.save commits the new annotation with null public_id, then fills it in with a separate commit. If there's a concurrent findAnnotations request which matches the annotation, it can be returned with {id: null} – a bit unfortunate.

Patch to follow to make Annotation.public_id non-nullable, and remove this window where it is null. (I haven't tested the Item.merge_with path – I've only tested the addAnnotation/findAnnotation path via the HTTP API.)

`Annotation.save` commits the new annotation with null `public_id`, then fills it in with a separate commit. If there's a concurrent `findAnnotations` request which matches the annotation, it can be returned with `{id: null} ` – a bit unfortunate. Patch to follow to make `Annotation.public_id` non-nullable, and remove this window where it is null. (I haven't tested the `Item.merge_with` path – I've only tested the `addAnnotation`/`findAnnotation` path via the HTTP API.)
wjt added the
backend
label 2015-09-08 07:41:09 +00:00
wjt added this to the 14.04 milestone 2015-09-08 07:41:09 +00:00
j was assigned by wjt 2015-09-08 07:41:09 +00:00
wjt added the
normal
defect
labels 2015-09-08 07:41:09 +00:00
Author

Attachment 0001-Make-Annotation.public_id-non-NULLable-fixes-2829.patch (39865 bytes) added

**Attachment** 0001-Make-Annotation.public_id-non-NULLable-fixes-2829.patch (39865 bytes) added
Author

In [pandora,5023]changeset:"pandora,5023":

#!CommitTicketReference repository="" revision="pandora,5023"
Make Annotation.public_id non-NULLable (fixes #2829)

This fixes this race:

     request 1                          request 2
     -----------------------------      -------------------------
     addAnnotation(...)
     super(Annotation.self).save()
                                        findAnnotations(...)
                                        returns [{id: null, ...}]
     annotation.public_id = x
     returns {id: x}
In [pandora,5023]changeset:"pandora,5023": ``` #!CommitTicketReference repository="" revision="pandora,5023" Make Annotation.public_id non-NULLable (fixes #2829) This fixes this race: request 1 request 2 ----------------------------- ------------------------- addAnnotation(...) super(Annotation.self).save() findAnnotations(...) returns [{id: null, ...}] annotation.public_id = x returns {id: x} ```
wjt added the
fixed
label 2015-09-14 12:18:59 +00:00
wjt closed this issue 2015-09-14 12:18:59 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: 0x2620/pandora#2829
No description provided.