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

Twentyfive #31

Merged
merged 6 commits into from
Aug 19, 2022
Merged

Twentyfive #31

merged 6 commits into from
Aug 19, 2022

Conversation

muir
Copy link
Collaborator

@muir muir commented Aug 18, 2022

No description provided.

@muir
Copy link
Collaborator Author

muir commented Aug 18, 2022

This isn't done yet.

@muir
Copy link
Collaborator Author

muir commented Aug 18, 2022

But it could use some careful review around the new Flush() and Done() code

@muir muir requested a review from miccagiann August 18, 2022 06:16
@codecov-commenter
Copy link

codecov-commenter commented Aug 18, 2022

Codecov Report

Merging #31 (ae2eaa3) into main (2d1e444) will increase coverage by 1.38%.
The diff coverage is 47.28%.

@@            Coverage Diff             @@
##             main      #31      +/-   ##
==========================================
+ Coverage   40.56%   41.95%   +1.38%     
==========================================
  Files           9        9              
  Lines         737      827      +90     
==========================================
+ Hits          299      347      +48     
- Misses        430      465      +35     
- Partials        8       15       +7     
Impacted Files Coverage Δ
sub.go 19.20% <20.40%> (+4.09%) ⬆️
span.go 18.96% <50.00%> (ø)
logger.go 57.55% <57.25%> (-1.85%) ⬇️
basegroup.go 36.25% <0.00%> (-1.76%) ⬇️
seed.go 78.94% <0.00%> (+7.89%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Collaborator

@miccagiann miccagiann left a comment

Choose a reason for hiding this comment

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

Ship IT!

log.parent.span.activeDependents = make(map[int32]*Log)
}
log.parent.span.activeDependents[log.span.spanNumber] = log
return len(log.parent.span.activeDependents) == 1
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why are we strictly checking if there is only one activeDependent? There is no use case where the parent can have many children?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If there is exactly one active dependent, then before this one was added, there were zero. If we go from zero to one then the parent has activity and hasActivity() needs to be called.

Comment on lines +299 to +300
postCount := log.recursiveDone(true)
if postCount > 1 && explicit {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wouldn't we always hit this condition due to line 278? I believe I figured it out if I see the publicly exposed Flush() method, which makes sure that recursiveDone is called with false parameter.

logger.go Outdated
Comment on lines 426 to 429
if requestStillBoring != 0 {
l.request.base.Boring(false)
l.request.span.base.Boring(false)
}
l.enableFlushTimer()
l.hasActivity(true)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe the condition in line 426 should be changed to if requestStillBoring == 0 {. This is because 0 value indicates that the request has become non-boring (at least that is what I understand).

@muir
Copy link
Collaborator Author

muir commented Aug 19, 2022

Thanks for the review. This Done/Flush stuff is pretty complicated.

@muir
Copy link
Collaborator Author

muir commented Aug 19, 2022

I think I've figured out why the tests are flaky on windows: the clock resolution may be too course to guarantee non-zero durations.

@muir muir merged commit 34f8431 into main Aug 19, 2022
@muir muir deleted the twentyfive branch August 19, 2022 05:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants