Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(Workflow): Avoid bubbling up "Unknown encoding" error to user #133

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 23, 2021

Conversation

vkarpov15
Copy link
Contributor

What was changed

I still end up getting the below error pretty regularly when I run a worker:

ValueError: Unknown encoding: 0u"Pu
    at CompositeDataConverter.fromPayload (/home/val/Workspace/temporalio/samples-node/hello-world/node_modules/@temporalio/workflow/lib/converter/data-converter.js:29:19)
    at Object.arrayFromPayloads (/home/val/Workspace/temporalio/samples-node/hello-world/node_modules/@temporalio/workflow/lib/converter/data-converter.js:57:28)
    at /home/val/Workspace/temporalio/samples-node/hello-world/node_modules/@temporalio/worker/lib/worker.js:318:55
    at rxjs_1.pipe.operators_1.mergeScan.state (/home/val/Workspace/temporalio/samples-node/hello-world/node_modules/@temporalio/worker/lib/rxutils.js:15:68)
    at MergeScanSubscriber._next (/home/val/Workspace/temporalio/samples-node/hello-world/node_modules/rxjs/internal/operators/mergeScan.js:55:23)
    at MergeScanSubscriber.Subscriber.next (/home/val/Workspace/temporalio/samples-node/hello-world/node_modules/rxjs/internal/Subscriber.js:66:18)
    at Subject.next (/home/val/Workspace/temporalio/samples-node/hello-world/node_modules/rxjs/internal/Subject.js:60:25)
    at GroupBySubscriber._group (/home/val/Workspace/temporalio/samples-node/hello-world/node_modules/rxjs/internal/operators/groupBy.js:98:19)
    at GroupBySubscriber._next (/home/val/Workspace/temporalio/samples-node/hello-world/node_modules/rxjs/internal/operators/groupBy.js:60:14)
    at GroupBySubscriber.Subscriber.next (/home/val/Workspace/temporalio/samples-node/hello-world/node_modules/rxjs/internal/Subscriber.js:66:18)

I don't think this error should propagate to the user, or at least we should log it but not crash the process re: discussion from #110 .

Why?

I usually end up having to re-run my worker 2-3 times to avoid it crashing due to this error.

Checklist

  1. Closes

  2. How was this tested:

  1. Any docs updates needed?

Copy link
Member

@bergundy bergundy left a comment

Choose a reason for hiding this comment

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

I don't want us to be silently ignoring this error.
Let's just fail Workflow execution instead of failing the worker.

@vkarpov15
Copy link
Contributor Author

@bergundy good call, see 8b593ff for the changes you requested

@vkarpov15 vkarpov15 force-pushed the vkarpov15/fix-unknown-encoding branch from 8b593ff to 5cd2983 Compare June 22, 2021 19:36
Copy link
Member

@bergundy bergundy left a comment

Choose a reason for hiding this comment

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

LGTM, had one nit.

@@ -700,7 +700,20 @@ export class Worker<T extends WorkerSpec = DefaultWorkerSpec> {
};
break;
}
const args = arrayFromPayloads(this.options.dataConverter, task.start?.input);
let args: any[];
Copy link
Member

Choose a reason for hiding this comment

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

nit: let's use unknown[], I'm still trying to remember to use unknown instead of any and TS has had that for a while now.

@vkarpov15 vkarpov15 enabled auto-merge (squash) June 23, 2021 16:49
@vkarpov15 vkarpov15 merged commit 0a831f7 into main Jun 23, 2021
@vkarpov15 vkarpov15 deleted the vkarpov15/fix-unknown-encoding branch June 23, 2021 19:01
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.

2 participants