profile
viewpoint

cretz/bine 565

Go library for accessing and embedding Tor clients and servers

cretz/asmble 501

Compile WebAssembly to JVM and other WASM tools

cretz/doogie 274

A Chromium-based web browser with tree-style pages

cretz/dust-php 69

Powerful PHP templating engine based off of Dust JS

cretz/esgopeta 7

Go implementation of the Gun distributed graph database

push eventcretz/temporal-sdk-go

Liang Mei

commit sha f9d61f2799047ef7baa999b0e88323492b4430ca

Add debug log for all errors received from RecordActivityHeartbeat (#657)

view details

Chad Retz

commit sha 960d3e909f0ea1d1cf4675f6797a61e3edd51162

Fix invalid command ID expectation on child workflow cancel (#647) Fixes #644

view details

Chad Retz

commit sha a707cbc593daf5b46ec4a42800ad4f7dfcf4287c

Expose gRPC (#651) Fixes #641

view details

Jacob LeGrone

commit sha 6c694d50ca0c8cbb4f9cc76d5181e1e4ae539dea

Add GetLogger method to Tracer interface (#655)

view details

Chad Retz

commit sha 2974de6f990157022e524c87c5ba8a26b8a73b14

Merge remote-tracking branch 'remotes/origin/master' into dependency-abstraction

view details

push time in 2 hours

delete tag cretz/temporal-sdk-go

delete tag : contrib/tally/v0.1.0

delete time in 2 hours

delete tag cretz/temporal-sdk-go

delete tag : v1.11.2

delete time in 2 hours

push eventcretz/temporal-sdk-go

Liang Mei

commit sha f9d61f2799047ef7baa999b0e88323492b4430ca

Add debug log for all errors received from RecordActivityHeartbeat (#657)

view details

Chad Retz

commit sha 960d3e909f0ea1d1cf4675f6797a61e3edd51162

Fix invalid command ID expectation on child workflow cancel (#647) Fixes #644

view details

Chad Retz

commit sha a707cbc593daf5b46ec4a42800ad4f7dfcf4287c

Expose gRPC (#651) Fixes #641

view details

Jacob LeGrone

commit sha 6c694d50ca0c8cbb4f9cc76d5181e1e4ae539dea

Add GetLogger method to Tracer interface (#655)

view details

push time in 2 hours

push eventtemporalio/sdk-go

Jacob LeGrone

commit sha 6c694d50ca0c8cbb4f9cc76d5181e1e4ae539dea

Add GetLogger method to Tracer interface (#655)

view details

push time in 2 hours

PR merged temporalio/sdk-go

Reviewers
Add GetLogger method to Tracer interface

<!--- Note to EXTERNAL Contributors --> <!-- Thanks for opening a PR! If it is a significant code change, please make sure there is an open issue for this. We work best with you when we have accepted the idea first before you code. -->

<!--- For ALL Contributors 👇 -->

What was changed

<!-- Describe what has changed in this PR -->

Adds a GetLogger method to the Tracer interface which allows tracer implementations to customize the logger used by workflow code.

There does not appear to be an ActivityOutboundInterceptor implementation for the tracingInterceptor struct, so customizing the activity logger was left out of scope for now.

This is likely to not be the last time a new method is needed on the Tracer interface, so a new BaseTracer struct has been added to allow this sort of change to be non-breaking in the future.

Why?

<!-- Tell your future self why have you made these changes -->

Some tracing backends can correlate logs with spans to enhance observability. This is really useful in the Temporal context, where the worker logs associated with each workflow and activity can be directly linked to a trace.

More info about this capability in Datadog is available here: https://docs.datadoghq.com/tracing/connect_logs_and_traces/

Checklist

<!--- add/delete as needed --->

  1. Closes <!-- add issue number here -->

  2. How was this tested: <!--- Please describe how you tested your changes/how we can test them -->

Not tested. ~Will move this out of draft state when more validation has been performed.~

  1. Any docs updates needed? <!--- update README if applicable or point out where to update docs.temporal.io -->
+37 -4

2 comments

3 changed files

jlegrone

pr closed time in 2 hours

pull request commenttemporalio/sdk-go

Add GetLogger method to Tracer interface

Gonna go ahead and merge this when done building

jlegrone

comment created time in 2 hours

push eventjlegrone/sdk-go

Liang Mei

commit sha f9d61f2799047ef7baa999b0e88323492b4430ca

Add debug log for all errors received from RecordActivityHeartbeat (#657)

view details

Chad Retz

commit sha 960d3e909f0ea1d1cf4675f6797a61e3edd51162

Fix invalid command ID expectation on child workflow cancel (#647) Fixes #644

view details

Chad Retz

commit sha a707cbc593daf5b46ec4a42800ad4f7dfcf4287c

Expose gRPC (#651) Fixes #641

view details

Chad Retz

commit sha 2164b7bab48587cdaae33c8aca49cd5e90d2f8b0

Merge branch 'master' into jlegrone/trace-logs

view details

push time in 2 hours

push eventcretz/temporal-sdk-features

Chad Retz

commit sha 9ea17f004e7e9a0980144346e29c62ea571b4391

TypeScript support

view details

push time in 2 hours

push eventcretz/temporal-sdk-features

Chad Retz

commit sha a9de2abd750249a67d6af3e742c7f9f20a58b0f0

TypeScript support

view details

push time in 2 hours

delete branch cretz/temporal-sdk-go

delete branch : cancel-panic

delete time in 2 hours

delete branch cretz/temporal-sdk-go

delete branch : expose-grpc

delete time in 2 hours

push eventtemporalio/sdk-go

Chad Retz

commit sha a707cbc593daf5b46ec4a42800ad4f7dfcf4287c

Expose gRPC (#651) Fixes #641

view details

push time in 2 hours

PR merged temporalio/sdk-go

Reviewers
Expose gRPC

What was changed

Added new Client.WorkflowService method that returns the underlying gRPC workflow service. Also expose gRPC dial options.

Why?

People want to do advanced things that they cannot do with only our high-level wrapper (e.g. #570). This is exposed in other SDKs so should be here as well.

Checklist

  1. Closes #641
+155 -61

0 comment

6 changed files

cretz

pr closed time in 2 hours

issue closedtemporalio/sdk-go

Expose gRPC

We have traditionally hidden the gRPC client and settings from the user, but the benefit of hiding gRPC no longer outweighs the cost of decreased user flexibility.

Two changes:

  1. Add WorkflowService() workflowservice.WorkflowServiceClient to Client
  2. Add GRPCDialOptions []grpc.DialOption to ConnectionOptions and apply our dial options first so any explicitly provided dial options could override our own if desired.

Questions:

  1. Maybe add some form of GetGRPCContext so that they can use the same context we use for making a gRPC call?

closed time in 2 hours

cretz

push eventcretz/temporal-sdk-go

Chad Retz

commit sha 3eee985090ecb726413ec5f71527217ad942ae16

Update Tally (#652) Fixes #645

view details

Liang Mei

commit sha f9d61f2799047ef7baa999b0e88323492b4430ca

Add debug log for all errors received from RecordActivityHeartbeat (#657)

view details

Chad Retz

commit sha 960d3e909f0ea1d1cf4675f6797a61e3edd51162

Fix invalid command ID expectation on child workflow cancel (#647) Fixes #644

view details

Chad Retz

commit sha 76307c0eef6af1c1efdd705dcf102747abddb6cc

Merge branch 'master' into expose-grpc

view details

push time in 5 hours

push eventtemporalio/sdk-go

Chad Retz

commit sha 960d3e909f0ea1d1cf4675f6797a61e3edd51162

Fix invalid command ID expectation on child workflow cancel (#647) Fixes #644

view details

push time in 5 hours

PR merged temporalio/sdk-go

Reviewers
Fix invalid command ID expectation on child workflow cancel

What was changed

The same change for #382, but to apply to child workflow cancel that does not call the base.

Why?

An extra event for cancellation is not being accounted for in event counting when a cancel occurs during un-waited-on child workflow.

Checklist

  1. Closes #644
+71 -14

2 comments

3 changed files

cretz

pr closed time in 5 hours

issue closedtemporalio/sdk-go

Workflow panics after cancellation with clean up activity and child workflow

Expected Behavior

No panic

Actual Behavior

If the intermediate workflow has a clean-up activity combined with a child workflow, it panics when root workflow gets canceled.

2021/11/21 20:05:05 ERROR Workflow panic Namespace default TaskQueue default WorkerID 1@6789789c47-xddcp@ WorkflowType MiddleWorkflow WorkflowID 19e5df4c-20ee-4800-818e-71a068512770_5 RunID d977d17c-4916-47f2-8460-d6fc18c28be9 Attempt 1 Error lookup failed for scheduledEventID to activityID: scheduleEventID: 15, activityID: 14 StackTrace process event for default [panic]:
go.temporal.io/sdk/internal.panicIllegalState(...)
	/go/pkg/mod/go.temporal.io/sdk@v1.11.1/internal/internal_decision_state_machine.go:395
go.temporal.io/sdk/internal.(*commandsHelper).handleActivityTaskScheduled(0xc0005983c0, {0xc00065ca28, 0x2}, 0x45b7954)
	/go/pkg/mod/go.temporal.io/sdk@v1.11.1/internal/internal_decision_state_machine.go:925 +0x10a
go.temporal.io/sdk/internal.(*workflowExecutionEventHandlerImpl).ProcessEvent(0xc0005b0318, 0xc00039bf40, 0xf8, 0x0)
	/go/pkg/mod/go.temporal.io/sdk@v1.11.1/internal/internal_event_handlers.go:816 +0x279
go.temporal.io/sdk/internal.(*workflowExecutionContextImpl).ProcessWorkflowTask(0xc0003c61c0, 0xc000760960)
	/go/pkg/mod/go.temporal.io/sdk@v1.11.1/internal/internal_task_handlers.go:878 +0xccd
go.temporal.io/sdk/internal.(*workflowTaskHandlerImpl).ProcessWorkflowTask(0xc00071c0c0, 0xc000760960, 0xc0009302d0)
	/go/pkg/mod/go.temporal.io/sdk@v1.11.1/internal/internal_task_handlers.go:729 +0x493
go.temporal.io/sdk/internal.(*workflowTaskPoller).processWorkflowTask(0xc0000a9520, 0xc000760960)
	/go/pkg/mod/go.temporal.io/sdk@v1.11.1/internal/internal_task_pollers.go:286 +0x2cd
go.temporal.io/sdk/internal.(*workflowTaskPoller).ProcessTask(0xc0000a9520, {0xfd7b00, 0xc000760960})
	/go/pkg/mod/go.temporal.io/sdk@v1.11.1/internal/internal_task_pollers.go:257 +0x6c
go.temporal.io/sdk/internal.(*baseWorker).processTask(0xc0003ae0f0, {0xfd76c0, 0xc0003dbbd0})
	/go/pkg/mod/go.temporal.io/sdk@v1.11.1/internal/internal_worker_base.go:343 +0xdd
created by go.temporal.io/sdk/internal.(*baseWorker).runTaskDispatcher
	/go/pkg/mod/go.temporal.io/sdk@v1.11.1/internal/internal_worker_base.go:270 +0xba
2021/11/21 20:05:05 WARN  Failed to process workflow task. Namespace default TaskQueue default WorkerID 1@6789789c47-xddcp@ WorkflowType MiddleWorkflow WorkflowID 19e5df4c-20ee-4800-818e-71a068512770_5 RunID d977d17c-4916-47f2-8460-d6fc18c28be9 Attempt 1 Error lookup failed for scheduledEventID to activityID: scheduleEventID: 15, activityID: 14

Steps to Reproduce the Problem

func RootWorkflow(ctx workflow.Context) error {
  info := workflow.GetInfo(ctx)

  ctx = workflow.WithChildOptions(ctx, workflow.ChildWorkflowOptions{
    TaskQueue:           info.TaskQueueName,
    WaitForCancellation: true,
    ParentClosePolicy:   enums.PARENT_CLOSE_POLICY_REQUEST_CANCEL,
  })

  err := workflow.ExecuteChildWorkflow(ctx, "IntermediateWorkflow").
    GetChildWorkflowExecution().
    Get(ctx, nil)
  if err != nil {
    return err
  }

  err = workflow.Sleep(ctx, time.Second * 30)
  if err != nil {
    return err
  }

  return errors.New("error")
}

func IntermediateWorkflow(ctx workflow.Context) error {
  info := workflow.GetInfo(ctx)
  ctx = workflow.WithActivityOptions(ctx, workflow.ActivityOptions{
    TaskQueue:           info.TaskQueueName,
    StartToCloseTimeout: time.Second * 20,
  })
  ctx = workflow.WithChildOptions(ctx, workflow.ChildWorkflowOptions{
    TaskQueue:           info.TaskQueueName,
    WaitForCancellation: true,
    ParentClosePolicy: enums.PARENT_CLOSE_POLICY_REQUEST_CANCEL,
  })
  cronWorkflow := workflow.ExecuteChildWorkflow(ctx, CRONWorkflow)

  defer func() {
    ctx, _ := workflow.NewDisconnectedContext(ctx)
    _ = workflow.ExecuteActivity(ctx, MiddleCleanUpActivity).Get(ctx, nil)
  }()

  var (
    err error
  )

  selector := workflow.NewSelector(ctx)
  selector.AddReceive(ctx.Done(), func(c workflow.ReceiveChannel, more bool) {
    c.Receive(ctx, nil)
    err = ctx.Err()
  })
  selector.AddFuture(cronWorkflow, func(f workflow.Future) {
    err = f.Get(ctx, nil)
  })
  selector.Select(ctx)

  return err
}

func CRONWorkflow(ctx workflow.Context) error {
  err := workflow.Sleep(ctx, time.Hour * 5)
  if err != nil {
    return err
  }

  return workflow.NewContinueAsNewError(ctx, CRONWorkflow)
}

func MiddleCleanUpActivity(ctx context.Context) error {
  return nil
}

Specifications

  • Version: 1.11.1
  • Platform: 1.13.1

closed time in 5 hours

nolotz

push eventcretz/temporal-sdk-go

Liang Mei

commit sha f9d61f2799047ef7baa999b0e88323492b4430ca

Add debug log for all errors received from RecordActivityHeartbeat (#657)

view details

Chad Retz

commit sha cba04e41824e2f3e0a0ec4b429428b645bd8893c

Merge branch 'master' into cancel-panic

view details

push time in 8 hours

PullRequestReviewEvent

issue commentcretz/temporal-debug-go

Add a license

:+1: Note, as kinda mentioned in the README, this is more experimental stuff. The code isn't really official and I wasn't really planning on retaining any kind of compatibility guarantees. I will add license and maybe more features on my next down time.

jlegrone

comment created time in 8 hours

issue commentDataDog/temporalite

package dependency error when installing temporalite

https://github.com/uber-go/tally/pull/171 was merged to hopefully solve this problem. Hopefully this replace will not be needed soon. But in the meantime, go.mod on the Temporal side does have this replace and since replaces aren't transitive, it would have to be applied here too.

larrymjordan

comment created time in a day

Pull request review commenttemporalio/sdk-typescript

feat(workflow): Handle unhandled rejections in workflow code

 export class WorkerThreadClient {        completion.resolve(result.output);     });+    workerThread.on('exit', () => {+      this.workerExited = true;+      if (this.shutDownRequested) {+        return; // ignore+      }+      const completions = this.requestIdToCompletion.values();+      this.requestIdToCompletion = new Map();+      for (const completion of completions) {+        completion.reject(+          new UnexpectedError(

We terminate the thread if it we can't determine the context that threw the handled error to avoid accidentally completing the activation successfully.

I am not following, sorry. In my head, I don't see why we'd ever allow user code to terminate a thread unless it's a very fatal error. We can't wrap everything a user may do in a recoverable scenario? Maybe have one error path that completes activation if you can determine the context and another that logs/swallows or whatever without doing something that could fail the whole worker.

Any workflow that can fail the worker or mess with the worker thread pool or whatever in any SDK, especially for something as trivial as a thrown exception in a promise not awaited on, seems bad. Maybe I'm misunderstanding the use here and overthinking "fail the worker".

bergundy

comment created time in a day

PullRequestReviewEvent

Pull request review commenttemporalio/sdk-typescript

feat(workflow): Handle unhandled rejections in workflow code

+import { proxyActivities } from '@temporalio/workflow';+import type * as activities from '../activities';++const { echo } = proxyActivities<typeof activities>({+  startToCloseTimeout: '1 minute',+});++export async function throwUnhandledRejection({ crashWorker }: { crashWorker: boolean }): Promise<void> {+  const p1 = (async () => {+    await echo('a');+  })();++  const p2 = (async () => {+    if (crashWorker) {+      throw 'not an error to crash the worker';+    } else {+      throw new Error('unhandled rejection');+    }+  })();++  await p1;+  await p2;

But since that promise is awaited on here, it throws here right? If you removed await p2 I think it'd be unhandled, but the promise is explicitly awaited on.

bergundy

comment created time in a day

PullRequestReviewEvent

pull request commenttemporalio/sdk-go

Dependency Abstraction and Multi-Module Repository

A draft PR for server side has been created: https://github.com/temporalio/temporal/pull/2243

cretz

comment created time in a day

PR opened temporalio/temporal

SDK update with dependency abstraction

What changed?

Incorporating dependency abstraction into separate modules from https://github.com/temporalio/sdk-go/pull/653

Why?

Demonstrate how the SDK module abstraction affects this repo.

How did you test it?

Instead of a replace in go.mod, I instead setup my own vanity import HTTP server on 127.0.0.1:80, set GOPRIVATE=go.temporal.io and GOINSECURE=go.temporal.io and pointed the repos at https://github.com/cretz/temporal-sdk-go and made two tags only in that fork: v1.11.2 for the root, and contrib/tally/v0.1.0 for just the Tally nested module.

+15 -9

0 comment

3 changed files

pr created time in a day

create barnchcretz/temporal

branch : sdk-dependency-abstraction

created branch time in a day

more