Skip to content

cre-5476: extra recovery (v2)#23132

Open
mchain0 wants to merge 2 commits into
developfrom
cre-5476-v2
Open

cre-5476: extra recovery (v2)#23132
mchain0 wants to merge 2 commits into
developfrom
cre-5476-v2

Conversation

@mchain0

@mchain0 mchain0 commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

cre-5476

ref. it's an alternative implementation to #23130

@github-actions

Copy link
Copy Markdown
Contributor

👋 mchain0, 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!

@mchain0
mchain0 requested a review from jmank88 July 15, 2026 15:01
@github-actions

Copy link
Copy Markdown
Contributor

I see you updated files related to core. Please run make gocs in the root directory to add a changeset as well as in the text include at least one of the following tags:

  • #added For any new functionality added.
  • #breaking_change For any functionality that requires manual action for the node to boot.
  • #bugfix For bug fixes.
  • #changed For any change to the existing functionality.
  • #db_update For any feature that introduces updates to database schema.
  • #deprecation_notice For any upcoming deprecation functionality.
  • #internal For changesets that need to be excluded from the final changelog.
  • #nops For any feature that is NOP facing and needs to be in the official Release Notes for the release.
  • #removed For any functionality/config that is removed.
  • #updated For any functionality that is updated.
  • #wip For any change that is not ready yet and external communication about it should be held off till it is feature complete.

@github-actions

Copy link
Copy Markdown
Contributor

✅ No conflicts with other open PRs targeting develop

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.

Is it important to have a separate table for panics? Could they be recorded as a variant of the existing results?

@mchain0 mchain0 Jul 15, 2026

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.

I guess you mean workflow_specs ? it's an independent lifecycle and semantic, separation of concerns and avoiding future db issues. imho simpler and more durable as separate

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.

I agree that workflow_specs is not fitting. Where do returned errors normally go?

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.

to logs and event. panic is not an erro. to avoid boot loop we need this persistence

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.

Do you mean that we don't persist the result of each execution already? I think that will be required for guaranteed execution, and it may be more natural to catalog these panics as a variant of execution failure. How about adding some columns for metadata that would allow us to bridge things later as the schema evolves? Maybe just execution ID? 🤔

@cl-sonarqube-production

Copy link
Copy Markdown

@trunk-io

trunk-io Bot commented Jul 15, 2026

Copy link
Copy Markdown

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

@mchain0
mchain0 requested review from MStreet3 and pavel-raykov July 15, 2026 15:20
Comment thread core/services/workflows/v2/panic_guard_test.go
"github.com/smartcontractkit/chainlink-common/pkg/logger"
)

// fakeModulePanicStore mimics job.KVStore: Get returns a wrapped sql.ErrNoRows

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

it mimics ModulePanicStore right? (and not job.KVStore)

@cedric-cordenier

Copy link
Copy Markdown
Contributor

@mchain0 IMO this feels like this is at the wrong level -- I agree we want some isolation against a similar class of bugs in the future, but it feels like this should be bound at the WASM module level, not at the engine level? I'm also not a fan of the extra state this introduces.

What do you think of adding a recover around the wasmtime module's execute and just erroring the execution if it happens? That should put the recover at a very granular and targeted spot enforcing the invariant that a wasm execution should never panic.

}
count++

var buf [8]byte

@pavel-raykov pavel-raykov Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

if this is a counter, why do you store it in a byte array and not into int directly? (this would avoid such conversions to byte array and back)

@mchain0

mchain0 commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

@mchain0 IMO this feels like this is at the wrong level -- I agree we want some isolation against a similar class of bugs in the future, but it feels like this should be bound at the WASM module level, not at the engine level? I'm also not a fan of the extra state this introduces.

What do you think of adding a recover around the wasmtime module's execute and just erroring the execution if it happens? That should put the recover at a very granular and targeted spot enforcing the invariant that a wasm execution should never panic.

I agree, we should never panic. This is already a second iteration of this, here is the previous attempt: #23130 (imho much better)

But @jmank88 disagree and express concern over the state. Please conclude on these concerns here.

@cedric-cordenier

Copy link
Copy Markdown
Contributor

@jmank88 What concerns do you have? If we scope this narrowly to the wasm module execution, I don't think there should be any issue around the state, we would abort + throwaway any related state, but maybe I'm missing something?

@jmank88

jmank88 commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

@jmank88 What concerns do you have? If we scope this narrowly to the wasm module execution, I don't think there should be any issue around the state, we would abort + throwaway any related state, but maybe I'm missing something?

#23130 (comment)

But it is not possible to know in the general case if a program is still in a healthy state after recovering from an arbitrary panic.

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