Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop overlaps when saving timespans #4830

Merged
merged 4 commits into from
Sep 17, 2020
Merged

Conversation

fm3
Copy link
Member

@fm3 fm3 commented Sep 17, 2020

There have been new reports of overlapping timespans. I have two vaguely unlikely theories how this could have happened:
(1) the singleton creation of the timespan service fails, there is more than one timespan service, so the merging fails
(2) there are negative durations in reported timespans due to weird request ordering or some unknown bug in the front-end

This PR deals with (2). Before, negative durations were considered interrupted, so new timespans were created in the db, with overlaps. Now, the overlap is detected and the timestamps that overlap into an existing timespan are dropped. Also, a warning is logged in this case (also including the service hash/id, hopefully giving us insights into both theories).

With the insights gained we should also be able to debug where the negative timespans, if any, come from.

URL of deployed dev instance (used for testing):

  • https://___.webknossos.xyz

Steps to test:

  • modify the frontend to randomize timestamps of update actions and/or info/finish requests
  • backend logging should warn about negative durations
  • the time tracking/db should not show overlaps

Issues:


@fm3 fm3 self-assigned this Sep 17, 2020
@fm3 fm3 assigned youri-k and unassigned youri-k Sep 17, 2020
@fm3 fm3 requested a review from youri-k September 17, 2020 12:32
Copy link
Contributor

@youri-k youri-k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :shipit:

@fm3 fm3 added the automerge label Sep 17, 2020
@bulldozer-boy bulldozer-boy bot merged commit 127a9b8 into master Sep 17, 2020
@bulldozer-boy bulldozer-boy bot deleted the negative-timespans branch September 17, 2020 13:40
fm3 added a commit that referenced this pull request Sep 17, 2020
* drop overlaps when saving timespans
* changelog
* Update TimeSpanService.scala
* Merge branch 'master' into negative-timespans
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants