Skip to content

ChIP Durable Emitter#1911

Open
DylanTinianov wants to merge 39 commits intomainfrom
durable-emitter-poc
Open

ChIP Durable Emitter#1911
DylanTinianov wants to merge 39 commits intomainfrom
durable-emitter-poc

Conversation

@DylanTinianov
Copy link
Copy Markdown
Contributor

@DylanTinianov DylanTinianov commented Mar 19, 2026

Creates ChIP DurableEmitter to persist and re-send Chip messages.
DurableEmitter Integration Testing + ORM

Comment thread pkg/beholder/durable_emitter.go Fixed
Comment thread pkg/beholder/durable_emitter.go Fixed
Comment thread pkg/beholder/durable_emitter.go Fixed
Comment thread pkg/beholder/durable_emitter.go Fixed
Comment thread pkg/beholder/durable_emitter.go Fixed
Comment thread pkg/beholder/durable_emitter.go Fixed
Comment thread pkg/beholder/durable_emitter.go Fixed
Comment thread pkg/beholder/durable_emitter.go Fixed
Comment thread pkg/beholder/durable_emitter.go Fixed
Comment thread pkg/beholder/durable_emitter.go Fixed
Comment thread pkg/beholder/durable_emitter.go Fixed
Comment thread pkg/beholder/durable_emitter.go Fixed
Comment thread pkg/beholder/durable_emitter.go Fixed
Comment thread pkg/beholder/durable_emitter.go Fixed
Comment thread pkg/beholder/durable_emitter.go Fixed
Comment thread pkg/beholder/durable_emitter.go Fixed
Comment thread pkg/beholder/durable_emitter.go Fixed
Comment thread pkg/beholder/durable_emitter.go Fixed
Comment thread pkg/beholder/durable_emitter.go Fixed
Comment thread pkg/beholder/durable_emitter.go Fixed
Comment thread pkg/beholder/durable_emitter.go Fixed
Comment thread pkg/beholder/durable_emitter.go Fixed
Comment thread pkg/beholder/durable_emitter.go Fixed
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 30, 2026

✅ API Diff Results - github.com/smartcontractkit/chainlink-common

✅ Compatible Changes (13)

pkg/beholder (13)
  • BatchInserter — ➕ Added

  • DefaultDurableEmitterConfig — ➕ Added

  • DurableEmitter — ➕ Added

  • DurableEmitterConfig — ➕ Added

  • DurableEmitterHooks — ➕ Added

  • DurableEmitterMetricsConfig — ➕ Added

  • DurableEvent — ➕ Added

  • DurableEventStore — ➕ Added

  • DurableQueueObserver — ➕ Added

  • DurableQueueStats — ➕ Added

  • MemDurableEventStore — ➕ Added

  • NewDurableEmitter — ➕ Added

  • NewMemDurableEventStore — ➕ Added


📄 View full apidiff report

d.metrics.publishBatchEvOK.Add(context.Background(), int64(len(batch)))
}

// Async MarkDelivered: the DB UPDATE runs in a background goroutine so
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

due to its async nature, is there a risk that a call to ListPending creates rework of tasks because this is in-flight?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah async mark implies ListPending can still see those rows and re-enqueue them until mark lands, which is a tradeoff. Not a big deal since we guarantee at least once delivery.

We can fix this in a follow-up PR

// avoiding send vs close races on publishCh.
func (d *DurableEmitter) Close() error {
close(d.stopCh)
if d.insertCh != nil {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

should we drain insertCh as a graceful shutdown?

Comment thread pkg/beholder/durable_emitter.go Outdated
Comment thread pkg/beholder/durable_emitter.go Outdated

// rawConn is the underlying gRPC connection when the client exposes it.
// Non-nil enables zero-copy batch publishing (protowire + ForceCodec).
rawConn *grpc.ClientConn
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we still fit into the interface if we consider implementing the emitter with a pool of conns?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

maybe we should do a first version without raw grpc calls and leave as a future optimization option

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That should be doable, probably not necessary for now though

Comment thread pkg/beholder/durable_emitter.go Outdated
Comment thread pkg/beholder/durable_emitter.go Outdated
Comment thread pkg/beholder/durable_emitter.go Outdated
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.

4 participants