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

[core] Span class can be finished only once #109

Merged
merged 1 commit into from
Apr 13, 2017
Merged

Conversation

palazzem
Copy link
Contributor

What it does

Calling span.finish() multiple times doesn't have any effect.

@palazzem palazzem added the bug Involves a bug label Apr 13, 2017
@palazzem palazzem added this to the 0.7.0 milestone Apr 13, 2017
@palazzem palazzem requested a review from ufoot April 13, 2017 09:06
@@ -91,6 +92,9 @@ def set_error(e)

# Mark the span finished at the current time and submit it.
def finish
return if @finished
@finished = true

Copy link
Contributor

Choose a reason for hiding this comment

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

Generally speaking, I'm all in for this, finish should be done only once. Then I'm a little worried about what it means to call finish_at. Because, here, finish_at can still be called many times, so its name becomes quite misleading. I don't know if it makes sense to move this test to finish_at so that this function too, can not be call twice. And the other question is, do we need the boolean or would !@end_time.nil? be enough to consider is "finishable".

@palazzem palazzem force-pushed the palazzem/double-finish branch from 1c0279f to 7a74efa Compare April 13, 2017 09:39
@palazzem palazzem force-pushed the palazzem/double-finish branch from 7a74efa to 2fc9cfc Compare April 13, 2017 09:41
Copy link
Contributor

@ufoot ufoot left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

self
end

# Proxy function that flag a span as finished with the given
# timestamp. This function is used for retro-compatibility.
# DEPRECATED: remove this function in the next release
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@palazzem palazzem merged commit 9d8e4fd into master Apr 13, 2017
@palazzem palazzem deleted the palazzem/double-finish branch April 13, 2017 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Involves a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants