Skip to content

DurableEmitter Optimizations#2224

Open
DylanTinianov wants to merge 19 commits into
mainfrom
CRE-5288-durable-emitter-slow-sql-fix
Open

DurableEmitter Optimizations#2224
DylanTinianov wants to merge 19 commits into
mainfrom
CRE-5288-durable-emitter-slow-sql-fix

Conversation

@DylanTinianov

@DylanTinianov DylanTinianov commented Jul 6, 2026

Copy link
Copy Markdown
Contributor
  • Coalesce deletes instead of marking delivered + purge loop.
  • Removes Fallback client (doesn't provide any value and adds complexity during outages).
  • Added page cursor to cycle through DB start point in retransmit loop to be proactive against events that never deliver from blocking other events from being resent.
  • Cleans up unnecessary DB calls and logs.

Tested on Reliability Env

@DylanTinianov DylanTinianov self-assigned this Jul 6, 2026
@DylanTinianov DylanTinianov requested a review from a team as a code owner July 6, 2026 16:25
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

👋 DylanTinianov, thanks for creating this pull request!

To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team.

Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks!

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

⚠️ API Diff Results - github.com/smartcontractkit/chainlink-common

⚠️ Breaking Changes (16)

pkg/durableemitter (1)
  • NewDurableEmitter — Type changed:
func(
  DurableEventStore, 
  BatchEmitter, 
  - github.com/smartcontractkit/chainlink-common/pkg/chipingress.Client, 
  bool, 
  Config, 
  github.com/smartcontractkit/chainlink-common/pkg/logger.Logger, 
  go.opentelemetry.io/otel/metric.Meter
)
(*DurableEmitter, error)
pkg/durableemitter.(*PgDurableEventStore) (4)
  • ListPending — Type changed:
func(
  context.Context, 
  time.Time, 
  + time.Time, 
  + int64, 
  int
)
([]DurableEvent, error)
  • MarkDelivered — 🗑️ Removed

  • MarkDeliveredBatch — 🗑️ Removed

  • PurgeDelivered — 🗑️ Removed

pkg/durableemitter.Config (5)
  • MarkBatchFlushInterval — 🗑️ Removed

  • MarkBatchSize — 🗑️ Removed

  • MarkBatchWorkers — 🗑️ Removed

  • PurgeBatchSize — 🗑️ Removed

  • PurgeInterval — 🗑️ Removed

pkg/durableemitter.DurableEventStore (5)
  • BatchDelete — ➕ Added

  • ListPending — Type changed:

func(
  context.Context, 
  time.Time, 
  + time.Time, 
  + int64, 
  int
)
([]DurableEvent, error)
  • MarkDelivered — 🗑️ Removed

  • MarkDeliveredBatch — 🗑️ Removed

  • PurgeDelivered — 🗑️ Removed

pkg/durableemitter.Hooks (1)
  • OnBatchMarkDelivered — 🗑️ Removed

✅ Compatible Changes (5)

pkg/durableemitter.(*PgDurableEventStore) (1)
  • BatchDelete — ➕ Added
pkg/durableemitter.Config (3)
  • DeleteBatchFlushInterval — ➕ Added

  • DeleteBatchSize — ➕ Added

  • DeleteBatchWorkers — ➕ Added

pkg/durableemitter.Hooks (1)
  • OnBatchDelete — ➕ Added

📄 View full apidiff report

@DylanTinianov DylanTinianov requested review from patrickhuie19 and tarcisiozf and removed request for ilija42 July 6, 2026 16:27
Comment thread pkg/custmsg/custom_message.go Outdated
Comment thread pkg/custmsg/custom_message.go Outdated
Comment thread pkg/durableemitter/store.go
@DylanTinianov DylanTinianov requested a review from tarcisiozf July 7, 2026 13:40
@DylanTinianov DylanTinianov changed the title DurableEmitter: Batch delete instead of mark DurableEmitter Improvements Jul 8, 2026
@DylanTinianov DylanTinianov changed the title DurableEmitter Improvements DurableEmitter Optimizations Jul 8, 2026
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.

3 participants