Skip to content

fix(engine): fail the node when its artifacts cannot be saved - #1199

Closed
pcbeingused333 wants to merge 1 commit into
Tencent:mainfrom
pcbeingused333:fix/node-artifact-write-failure
Closed

pcbeingused333 wants to merge 1 commit into
Tencent:mainfrom
pcbeingused333:fix/node-artifact-write-failure

Conversation

@pcbeingused333

Copy link
Copy Markdown

Fixes #1092

What changed

When the store rejects a node's outcome write (the reported case: a required artifact larger than 64 KiB on MySQL, where run_artifacts.content is text), the node now fails with the store error instead of staying running, and artifact.published is no longer emitted for an artifact that was never saved.

Root cause: in internal/engine/node_execute.go the completion path saved the outcome and artifacts with e.updateRun(...), which logs and drops the store error, and then emitted artifact.published unconditionally. The SOP node path already uses updateRunErr plus nodeFailedAt for this.

Fix: use updateRunErr for the completion write. If the store rejects it, fail the node (保存节点产物失败:<store error>) through the existing failNode path, so retries and failure edges behave as for any other node failure, and skip the artifact.published events.

Not changed here: widening run_artifacts.content to MEDIUMTEXT on MySQL (new schema plus a migration for existing databases) would let this artifact size be archived at all. That is a schema decision for the maintainers; happy to send it as a separate PR if wanted.

Scope

  • Platform core / API / runner
  • Public adapter / deployment
  • Classic
  • Portable
  • Shared behavior contract
  • Installer / CLI
  • Documentation only

Compatibility

Platform engine only. No schema, API or migration change. A node whose outcome cannot be stored now ends failed (retryable through the usual attempts/failure edges) instead of hanging in running.

Validation

TestScriptNodeArtifactWriteFailureFailsNode makes the store reject the artifact insert for a script node (SQLite trigger). Without the fix the run stays running; with it the node is failed with the store error and no artifact.published event is emitted.

go test ./internal/engine -run TestScriptNodeArtifactWriteFailureFailsNode -count=1   # fails without the fix (status=running), passes with it
go test ./internal/engine                                                              # passes

Not run: the full go test -p=2 ./..., go vet ./..., the local/ scripts and the browser suites (no local/ or UI changes). Not reproduced against a real MySQL instance.

Safety

  • I did not include credentials, internal endpoints, production data, or organization-specific infrastructure.
  • I preserved user files and unrelated changes.
  • I updated generated Classic host bundles when applicable.
  • I documented third-party content and licensing changes when applicable.

This pull request was prepared with the assistance of an AI coding agent (Claude Code) and submitted by Alex Castillo, who is responsible for its content.

Node completion wrote outcome and artifacts with updateRun, which drops the store error, then emitted artifact.published. When the store rejected the write (for example an artifact larger than the MySQL TEXT column) the node stayed running and downstream nodes never started. Use updateRunErr and fail the node on a rejected write, as the SOP node already does.
@pcbeingused333

Copy link
Copy Markdown
Author

#1301 has landed on main and covers this: a rejected outcome write now settles the node with the store error, artifact.published is only emitted after the commit, and the artifact column is widened. Closing this one as superseded.

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.

[Bug]: MySQL TEXT artifact exceeds 64 KiB and leaves SOP node running

1 participant