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

Client doesn't account for adjustments to system clock. #77

Closed
rnburn opened this issue Sep 9, 2019 · 1 comment · May be fixed by #95
Closed

Client doesn't account for adjustments to system clock. #77

rnburn opened this issue Sep 9, 2019 · 1 comment · May be fixed by #95
Assignees
Labels

Comments

@rnburn
Copy link

rnburn commented Sep 9, 2019

It's not guaranteed that successive calls to time.time return increasing values.
From https://docs.python.org/3/library/time.html#time.time:

While this function normally returns non-decreasing values, it can return a lower value than a previous call if the system clock has been set back between the two calls.

When this happens, the tracer crashes

22:19:35.163 ERROR benchmark.controller.python_client:   File "/usr/local/lib/python3.7/dist-packages/opentracing/scope.py", line 84, in __exit__
22:19:35.164 ERROR benchmark.controller.python_client:     self.close()
22:19:35.166 ERROR benchmark.controller.python_client:   File "/usr/local/lib/python3.7/dist-packages/opentracing/scope_managers/__init__.py", line 77, in close
22:19:35.167 ERROR benchmark.controller.python_client:     self.span.finish()
22:19:35.169 ERROR benchmark.controller.python_client:   File "/usr/local/lib/python3.7/dist-packages/basictracer/span.py", line 56, in finish
22:19:35.181 ERROR benchmark.controller.python_client:     self._tracer.record(self)
22:19:35.184 ERROR benchmark.controller.python_client:   File "/usr/local/lib/python3.7/dist-packages/basictracer/tracer.py", line 131, in record
22:19:35.187 ERROR benchmark.controller.python_client:     self.recorder.record_span(span)
22:19:35.192 ERROR benchmark.controller.python_client:   File "/usr/local/lib/python3.7/dist-packages/lightstep/recorder.py", line 150, in record_span
22:19:35.195 ERROR benchmark.controller.python_client:     span_record = self.converter.create_span_record(span, self.guid)
22:19:35.196 ERROR benchmark.controller.python_client:   File "/usr/local/lib/python3.7/dist-packages/lightstep/http_converter.py", line 48, in create_span_record
22:19:35.197 ERROR benchmark.controller.python_client:     duration_micros=int(util._time_to_micros(span.duration)))
22:19:35.198 ERROR benchmark.controller.python_client: ValueError: Value out of range: -35253
@carlosalberto
Copy link
Contributor

Uh, interesting. Thanks for reporting this. Will put it in my TODO

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants