Skip to content

Commit

Permalink
Merge branch 'main' into refine-buckets
Browse files Browse the repository at this point in the history
  • Loading branch information
gammazero authored Nov 19, 2024
2 parents b363199 + 5929aca commit d228a3e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion bitswap/server/internal/decision/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,12 +378,13 @@ func wrapTaskComparator(tc TaskComparator) peertask.QueueTaskComparator {
// maxOutstandingBytesPerPeer hints to the peer task queue not to give a peer
// more tasks if it has some maximum work already outstanding.
func NewEngine(
ctx context.Context,
bs bstore.Blockstore,
peerTagger PeerTagger,
self peer.ID,
opts ...Option,
) *Engine {
ctx, cancel := context.WithCancel(context.Background())
ctx, cancel := context.WithCancel(ctx)

e := &Engine{
scoreLedger: NewDefaultScoreLedger(),
Expand Down
2 changes: 1 addition & 1 deletion bitswap/server/internal/decision/engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ func newEngineForTesting(
opts ...Option,
) *Engine {
opts = append(opts, WithWantHaveReplaceSize(wantHaveReplaceSize))
return NewEngine(bs, peerTagger, self, opts...)
return NewEngine(context.Background(), bs, peerTagger, self, opts...)
}

func TestOutboxClosedWhenEngineClosed(t *testing.T) {
Expand Down
1 change: 1 addition & 0 deletions bitswap/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ func New(ctx context.Context, network bsnet.BitSwapNetwork, bstore blockstore.Bl
}

s.engine = decision.NewEngine(
ctx,
bstore,
network.ConnectionManager(),
network.Self(),
Expand Down
2 changes: 1 addition & 1 deletion docs/tracing.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,6 @@ the complete trace of this request.
[Open Telemetry]: https://opentelemetry.io/
[opentelemetry-go]: https://github.com/open-telemetry/opentelemetry-go
[Trace Context]: https://www.w3.org/TR/trace-context
[OpenTelemetry Environment Variable Specification]: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/sdk-environment-variables.md
[OpenTelemetry Environment Variable Specification]: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md
[OpenTelemetry Protocol Exporter]: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md
[Jaeger UI]: https://github.com/jaegertracing/jaeger-ui

0 comments on commit d228a3e

Please sign in to comment.