-
Notifications
You must be signed in to change notification settings - Fork 137
Fix CircleCI build (part 2) #193
Conversation
7f4aaf7
to
3378378
Compare
i'm curious about the benchmarking/performance of the labels refactoring. The prior table-based lookup approach really lowered label generation times (performance was key concern of @kozyraki). The new implementation looks more involved so I'm wondering what that does to label generation times. |
@@ -9,5 +9,5 @@ dependencies: | |||
test: | |||
override: | |||
- ! gofmt -s -d . 2>&1 | read | |||
- gometalinter ./... | |||
- gometalinter --cyclo-over=12 ./... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how did we pick 12? why not 13, or 15?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The lower, the better. But at some point we cross a threshold that doesn't make sense anymore. I found this value through quite extensive experimentation.
I can run the benchmarks tomorrow for the two versions but I'd like to see valid data backed evidence of what real performance requirements are for label generation. I'd be very surprised if it would be a bottleneck and I'd optimise for maintainability, composability and modularity first. |
4aa950c
to
c72ae07
Compare
) | ||
|
||
// Counter defines an interface for a monotonically incrementing counter. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds like a tautology. s/counter/integer/
In fact, it's a write-only counter. How can one read the value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
users of the Counter API aren't meant to read the value. Counter values are rendered periodically in the logs, and so LogCounter.String() is invoked to display the value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll s/counter/value/
to remove the tautology.
if m.Rcode != 3 { | ||
t.Error("not setting NXDOMAIN for AAAA requests") | ||
if got, want := m.Rcode, dns.RcodeNameError; got != want { | ||
t.Errorf("not setting NXDOMAIN for AAAA requests: got rcode: %v, want: %v", got, want) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rcode or Rcode as above? same for got/want vs. Answer.
} | ||
m.Rcode = dns.RcodeNameError | ||
if qType == dns.TypeAAAA && len(rs.SRVs[name])+len(rs.As[name]) > 0 { | ||
m.Rcode = dns.RcodeSuccess |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code path is guarded now by len(m.Answer)==0
. It wasn't before. Problem?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's OK since dns.RcodeSuccess
is the default value.
4554ea1
to
34b158b
Compare
@sttts: PTAL again :-) |
|
||
} | ||
} | ||
if err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the error case take precedence over the len==0 case? Now a handler which throws an error will possibly also return an empty answer and then the error never shows up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which is what was previously happening, unfortunately. But I'll change it.
A few comments, otherwise lgtm |
👍 |
This change set brings us a little closer to have a green CircleCI build. After this is merged, the remaining failures are very few:
EDIT: I reduced the scope of this PR to NOT include the
label
package refactoring. That will follow up in a different PR. This way we can get this code in right away I hope.