Skip to content

Commit 464c448

Browse files
authored
Add missing commit, bump version to 0.8.1 (#886)
* Address review Signed-off-by: Jakub Sztandera <[email protected]> * Bump version Signed-off-by: Jakub Sztandera <[email protected]> --------- Signed-off-by: Jakub Sztandera <[email protected]>
1 parent a4b857e commit 464c448

File tree

3 files changed

+15
-18
lines changed

3 files changed

+15
-18
lines changed

manifest/fusing_provider.go

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ func (m *FusingManifestProvider) Start(ctx context.Context) error {
8585
first := true
8686
for m.runningCtx.Err() == nil {
8787
if !first {
88-
m.clock.Sleep(5 * time.Second)
88+
// sleep for a second if re-trying to avoid hot-looping
89+
m.clock.Sleep(1 * time.Second)
8990
first = false
9091
}
9192

@@ -115,10 +116,6 @@ func (m *FusingManifestProvider) Start(ctx context.Context) error {
115116
startTime := startTimeOfPriority(head, primaryManifest)
116117
log.Infof("starting the fusing manifest provider, will switch to the primary manifest at %s",
117118
startTime)
118-
if err != nil {
119-
log.Errorf("trying to compute start time: %w", err)
120-
continue
121-
}
122119
timer.Reset(m.clock.Until(startTime))
123120
break
124121
}
@@ -169,9 +166,9 @@ func (m *FusingManifestProvider) Start(ctx context.Context) error {
169166
fallthrough
170167
case head.Epoch() < switchEpoch:
171168
log.Infow("delaying fusing manifest switch-over because head is behind the target epoch",
172-
"head", head.Epoch(),
173-
"target epoch", switchEpoch,
174-
"bootstrap epoch", primaryManifest.BootstrapEpoch,
169+
"target_epoch", switchEpoch,
170+
"bootstrap_epoch", primaryManifest.BootstrapEpoch,
171+
"current_epoch", head.Epoch(),
175172
)
176173
timer.Reset(primaryManifest.EC.Period)
177174
continue
@@ -180,8 +177,8 @@ func (m *FusingManifestProvider) Start(ctx context.Context) error {
180177
log.Infow(
181178
"fusing to the primary manifest, stopping the secondary manifest provider",
182179
"network", primaryManifest.NetworkName,
183-
"bootstrap epoch", primaryManifest.BootstrapEpoch,
184-
"current epoch", head.Epoch(),
180+
"bootstrap_epoch", primaryManifest.BootstrapEpoch,
181+
"current_epoch", head.Epoch(),
185182
)
186183
m.updateManifest(primaryManifest)
187184
return nil

manifest/fusing_provider_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ func TestFusingManifestProvider(t *testing.T) {
7171
t.Fatal("expected a manifest update")
7272
}
7373

74-
// Now update the dynamic manifest. We shouldn't receive it.
74+
// Now update the secondary manifest. We shouldn't receive it.
7575
select {
7676
case manifestCh <- &otherManifest:
7777
default:
@@ -132,18 +132,18 @@ func TestFusingManifestProviderSwitchToPriority(t *testing.T) {
132132
require.NoError(t, prov.Start(ctx))
133133
priorityManifestCh <- initialManifest
134134

135-
// Create and push a dynamic manifest with bootstrap epoch < 1100
136-
dynamicManifest := *initialManifest
137-
dynamicManifest.BootstrapEpoch = 1000
135+
// Create and push a secondary manifest with bootstrap epoch < 1100
136+
secondaryManifest := *initialManifest
137+
secondaryManifest.BootstrapEpoch = 1000
138138
select {
139-
case manifestCh <- &dynamicManifest:
139+
case manifestCh <- &secondaryManifest:
140140
default:
141-
t.Fatal("failed to enqueue dynamic manifest")
141+
t.Fatal("failed to enqueue secondary manifest")
142142
}
143143

144144
select {
145145
case m := <-prov.ManifestUpdates():
146-
require.True(t, m.Equal(&dynamicManifest), "expected dynamic manifest")
146+
require.True(t, m.Equal(&secondaryManifest), "expected secondary manifest")
147147
case <-time.After(time.Second):
148148
t.Fatal("expected a manifest update")
149149
}

version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"version": "v0.8.0"
2+
"version": "v0.8.1"
33
}

0 commit comments

Comments
 (0)