internal/index: Format to nanoseconds for index URL.
The golang index supports both:
- https://index.golang.org/index?since=2019-04-10T20:30:42Z&limit=3
- https://index.golang.org/index?since=2019-04-10T20:30:42.400000Z&limit=3
Since this is part of the checkpointing cursor behaviour that the worker relies
on to make progress, a higher precision means less change of missing something.
So, this change makes us use the highest precision available.
Note that since postgres only has microsecond granularity we're actually going
to be querying at microsecond granularity, but anyways, that's just a semantic
detail as far as this change is concerned. We still get higher precision.
(This change was inspired by our debugging cursor progress issues against our
internal golang-index https://github.com/netflix-skunkworks/golang-index).
diff --git a/internal/index/index.go b/internal/index/index.go
index f331d75..33a408c 100644
--- a/internal/index/index.go
+++ b/internal/index/index.go
@@ -43,7 +43,7 @@
func (c *Client) pollURL(since time.Time, limit int) string {
values := url.Values{}
- values.Set("since", since.Format(time.RFC3339))
+ values.Set("since", since.Format(time.RFC3339Nano))
if limit > 0 {
values.Set("limit", strconv.Itoa(limit))
}
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +2 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
JFYI that i don't have trybots permission, so if somebody could help me kick those off I'd be appreciative! =)
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Auto-Submit | +1 |
| Commit-Queue | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Kokoro presubmit build finished with status: SUCCESS
Logs at: https://source.cloud.google.com/results/invocations/09b1ef4a-3374-4fc9-ad95-3718f921704d
| kokoro-CI | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
internal/index: Format to nanoseconds for index URL.```suggestion
internal/index: format to nanoseconds for index URL.
```
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
```suggestion
internal/index: format to nanoseconds for index URL.
```
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Auto-Submit | +1 |
| Code-Review | +2 |
| Commit-Queue | +1 |
kokoro rerun
Kokoro presubmit build finished with status: SUCCESS
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
internal/index: format to nanoseconds for index URL.
The golang index supports both:
- https://index.golang.org/index?since=2019-04-10T20:30:42Z&limit=3
- https://index.golang.org/index?since=2019-04-10T20:30:42.400000Z&limit=3
And notably returns different results. That's because between the 42s
mark and the 43s mark, new modules got indexed. So, at second
granularity, you need your cursor's window size to be big enough to
capture everything that changed in that second, or else risk missing
modules OR not making progress beyond that second.
The higher your precision, the less things can fit in the window,
meaning that the cursor has a higher change to make progress / not lose
anything.
So, this change makes us use the highest precision available (second ->
nano).
Note that since postgres only has microsecond granularity we're actually
going to be querying at microsecond granularity, but anyways, that's
just a semantic detail as far as this change is concerned. We still get
higher precision.
(This change was inspired by our debugging cursor progress issues
against our internal golang-index
https://github.com/netflix-skunkworks/golang-index).
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |