Skip to content
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

[Features Platform] continue_as_new/continue_as_same feature does not pass against cloud #582

Closed
dandavison opened this issue Jan 17, 2025 · 1 comment · Fixed by #601
Closed

Comments

@dandavison
Copy link
Contributor

dandavison commented Jan 17, 2025

See e.g. https://github.com/temporalio/features/actions/runs/12835436433/job/35794872814?pr=577

The workflow seems to be exiting prematurely. Let's double-check that the assertions are being made at the correct point in the workflow lifecycle also.

@roxblnfk @rustation

Running check Harness\Feature\ContinueAsNew\ContinueAsSame\FeatureChecker::check FAILED
Temporal\Exception\Client\TimeoutException {#325
  #message: "Deadline Exceeded (code: 4)"
  #code: 4
  #file: "./vendor/temporal/sdk/src/Client/GRPC/BaseClient.php"
  #line: 291
  -previous: Temporal\Exception\Client\ServiceClientException {#307
    #message: "Deadline Exceeded (code: 4)"
    #code: 4
    #file: "./vendor/temporal/sdk/src/Client/GRPC/BaseClient.php"
    #line: [28](https://github.com/temporalio/features/actions/runs/12835436433/job/35794872814?pr=577#step:9:29)4
    -status: Google\Rpc\Status {#314
      message: "google.rpc.Status"
      values: []
    }
    trace: {
      ./vendor/temporal/sdk/src/Client/GRPC/BaseClient.php:284 { …}
      ./vendor/temporal/sdk/src/Client/GRPC/BaseClient.php:252 { …}
      ./vendor/temporal/sdk/src/Client/GRPC/ServiceClient.php:137 { …}
      ./vendor/temporal/sdk/src/Internal/Client/WorkflowStub.php:576 { …}
      ./vendor/temporal/sdk/src/Internal/Client/WorkflowStub.php:491 { …}
      ./vendor/temporal/sdk/src/Internal/Client/WorkflowStub.php:423 { …}
      ./vendor/temporal/sdk/src/Internal/Interceptor/Pipeline.php:92 { …}
      ./vendor/temporal/sdk/src/Internal/Client/WorkflowStub.php:432 { …}
      /app/features/continue_as_new/continue_as_same/feature.php:62 {
        Harness\Feature\ContinueAsNew\ContinueAsSame\FeatureChecker::check(WorkflowStubInterface $stub): void
        › ): void {
        ›     Assert::same($stub->getResult(), INPUT_DATA);
        ›     # Workflow ID does not change after continue as new
      }
      Harness\Feature\ContinueAsNew\ContinueAsSame\FeatureChecker::check() {}
      ./vendor/spiral/core/src/Internal/Invoker.php:59 { …}
      ./vendor/spiral/core/src/Container.php:[29](https://github.com/temporalio/features/actions/runs/12835436433/job/35794872814?pr=577#step:9:30)2 { …}
      /app/harness/php/runner.php:108 { …}
      {closure}() {}
      ./vendor/spiral/core/src/Internal/Invoker.php:77 { …}
      ./vendor/spiral/core/src/Container.php:292 { …}
      ./vendor/spiral/core/src/Container.php:404 { …}
      ./vendor/spiral/core/src/ContainerScope.php:46 { …}
      ./vendor/spiral/core/src/Container.php:399 { …}
      ./vendor/spiral/core/src/Container.php:181 { …}
      /app/harness/php/runner.php:99 { …}
    }
  }
  trace: {
    ./vendor/temporal/sdk/src/Client/GRPC/BaseClient.php:291 { …}
    ./vendor/temporal/sdk/src/Client/GRPC/BaseClient.php:252 { …}
    ./vendor/temporal/sdk/src/Client/GRPC/ServiceClient.php:137 { …}
    ./vendor/temporal/sdk/src/Internal/Client/WorkflowStub.php:576 { …}
    ./vendor/temporal/sdk/src/Internal/Client/WorkflowStub.php:491 { …}
    ./vendor/temporal/sdk/src/Internal/Client/WorkflowStub.php:423 { …}
    ./vendor/temporal/sdk/src/Internal/Interceptor/Pipeline.php:92 { …}
    ./vendor/temporal/sdk/src/Internal/Client/WorkflowStub.php:4[32](https://github.com/temporalio/features/actions/runs/12835436433/job/35794872814?pr=577#step:9:33) { …}
    /app/features/continue_as_new/continue_as_same/feature.php:62 {
      Harness\Feature\ContinueAsNew\ContinueAsSame\FeatureChecker::check(WorkflowStubInterface $stub): void
      › ): void {
      ›     Assert::same($stub->getResult(), INPUT_DATA);
      ›     # Workflow ID does not change after continue as new
    }
    Harness\Feature\ContinueAsNew\ContinueAsSame\FeatureChecker::check() {}
    ./vendor/spiral/core/src/Internal/Invoker.php:59 { …}
    ./vendor/spiral/core/src/Container.php:292 { …}
    /app/harness/php/runner.php:108 { …}
    {closure}() {}
    ./vendor/spiral/core/src/Internal/Invoker.php:77 { …}
    ./vendor/spiral/core/src/Container.php:292 { …}
    ./vendor/spiral/core/src/Container.php:404 { …}
    ./vendor/spiral/core/src/ContainerScope.php:46 { …}
    ./vendor/spiral/core/src/Container.php:[39](https://github.com/temporalio/features/actions/runs/12835436433/job/35794872814?pr=577#step:9:40)9 { …}
    ./vendor/spiral/core/src/Container.php:181 { …}
    /app/harness/php/runner.php:99 { …}
  }
}
-> /app/features/continue_as_new/continue_as_same/feature.php:62
TimeoutException
Deadline Exceeded (code: 4)
ServiceClientException
Deadline Exceeded (code: 4)
Temporal\Exception\Client\WorkflowExecutionAlreadyStartedException {#321
  #message: "runId='ea5a377f-b9a2-4285-a72b-af2541b1719d', workflowType='Workflow'"
  #code: 0
  #file: "./vendor/temporal/sdk/src/Internal/Client/WorkflowStarter.php"
  #line: 291
  -previous: Temporal\Exception\Client\ServiceClientException {#264
    #message: "Workflow execution already finished successfully. WorkflowId: TestID, RunId: ea5a377f-b9a2-4285-a72b-af2541b1719d. Workflow Id reuse policy: allow duplicate workflow Id if last run failed. (code: 6)"
    #code: 6
    #file: "./vendor/temporal/sdk/src/Client/GRPC/BaseClient.php"
    #line: 284
    -status: Google\Rpc\Status {#312
      message: "google.rpc.Status"
      values: array:3 [
        "code" => 6
        "message" => "Workflow execution already finished successfully. WorkflowId: TestID, RunId: ea5a377f-b9a2-4285-a72b-af2541b1719d. Workflow Id reuse policy: allow duplicate workflow Id if last run failed."
        "details" => array:1 [
          0 => array:3 [
            "@type" => "type.googleapis.com/temporal.api.errordetails.v1.WorkflowExecutionAlreadyStartedFailure"
            "startRequestId" => "79be0125-9281-44e5-bf9b-f1a48fd20adc"
            "runId" => "ea5a377f-b9a2-4285-a72b-af2541b1719d"
          ]
        ]
      ]
    }
    trace: {
      ./vendor/temporal/sdk/src/Client/GRPC/BaseClient.php:284 { …}
      ./vendor/temporal/sdk/src/Client/GRPC/BaseClient.php:252 { …}
      ./vendor/temporal/sdk/src/Client/GRPC/ServiceClient.php:96 { …}
      ./vendor/temporal/sdk/src/Internal/Client/WorkflowStarter.php:283 { …}
      ./vendor/temporal/sdk/src/Internal/Client/WorkflowStarter.php:76 { …}
      ./vendor/temporal/sdk/src/Internal/Interceptor/Pipeline.php:92 { …}
      ./vendor/temporal/sdk/src/Internal/Client/WorkflowStarter.php:81 { …}
      ./vendor/temporal/sdk/src/Client/WorkflowClient.php:136 { …}
      /app/harness/php/src/Feature/WorkflowStubInjector.php:60 {
        Harness\Feature\WorkflowStubInjector->createInjection(ReflectionClass $class, ReflectionParameter|string|null $context = null): WorkflowStubInterface
        › $stub = $client->newUntypedWorkflowStub($attribute->type, $options);
        › $client->start($stub, ...$attribute->args);
        › 
        arguments: {
          $workflow: Temporal\Internal\Client\WorkflowStub {#315 …}
          ...$args: {
            "InputData"
          }
        }
      }
      ./vendor/spiral/core/src/Internal/Factory.php:157 { …}
      ./vendor/spiral/core/src/Internal/Factory.php:101 { …}
      ./vendor/spiral/core/src/Internal/Factory.php:331 { …}
      ./vendor/spiral/core/src/Internal/Factory.php:78 { …}
      ./vendor/spiral/core/src/Internal/Container.php:59 { …}
      ./vendor/spiral/core/src/Internal/Resolver.php:276 { …}
      ./vendor/spiral/core/src/Internal/Resolver.php:218 { …}
      ./vendor/spiral/core/src/Internal/Resolver.php:52 { …}
      ./vendor/spiral/core/src/Internal/Invoker.php:61 { …}
      ./vendor/spiral/core/src/Container.php:282 { …}
      /app/harness/php/runner.php:108 { …}
      {closure}() {}
      ./vendor/spiral/core/src/Internal/Invoker.php:77 { …}
      ./vendor/spiral/core/src/Container.php:282 { …}
      ./vendor/spiral/core/src/Container.php:407 { …}
      ./vendor/spiral/core/src/ContainerScope.php:45 { …}
      ./vendor/spiral/core/src/Container.php:402 { …}
      ./vendor/spiral/core/src/Container.php:169 { …}
      /app/harness/php/runner.php:99 { …}
    }
  }
  -execution: Temporal\Workflow\WorkflowExecution {#284
    -id: "TestID"
    -runId: "ea5a377f-b9a2-4285-a72b-af2541b1719d"
  }
  -type: "Workflow"
  trace: {
    ./vendor/temporal/sdk/src/Internal/Client/WorkflowStarter.php:291 { …}
    ./vendor/temporal/sdk/src/Internal/Client/WorkflowStarter.php:76 { …}
    ./vendor/temporal/sdk/src/Internal/Interceptor/Pipeline.php:92 { …}
    ./vendor/temporal/sdk/src/Internal/Client/WorkflowStarter.php:81 { …}
    ./vendor/temporal/sdk/src/Client/WorkflowClient.php:136 { …}
    /app/harness/php/src/Feature/WorkflowStubInjector.php:60 {
      Harness\Feature\WorkflowStubInjector->createInjection(ReflectionClass $class, ReflectionParameter|string|null $context = null): WorkflowStubInterface
      › $stub = $client->newUntypedWorkflowStub($attribute->type, $options);
      › $client->start($stub, ...$attribute->args);
      › 
      arguments: {
        $workflow: Temporal\Internal\Client\WorkflowStub {#315 …}
        ...$args: {
          "InputData"
        }
      }
    }
    ./vendor/spiral/core/src/Internal/Factory.php:157 { …}
    ./vendor/spiral/core/src/Internal/Factory.php:101 { …}
    ./vendor/spiral/core/src/Internal/Factory.php:331 { …}
    ./vendor/spiral/core/src/Internal/Factory.php:78 { …}
    ./vendor/spiral/core/src/Internal/Container.php:59 { …}
    ./vendor/spiral/core/src/Internal/Resolver.php:276 { …}
    ./vendor/spiral/core/src/Internal/Resolver.php:218 { …}
    ./vendor/spiral/core/src/Internal/Resolver.php:52 { …}
    ./vendor/spiral/core/src/Internal/Invoker.php:61 { …}
    ./vendor/spiral/core/src/Container.php:282 { …}
    /app/harness/php/runner.php:108 { …}
    {closure}() {}
    ./vendor/spiral/core/src/Internal/Invoker.php:77 { …}
    ./vendor/spiral/core/src/Container.php:282 { …}
    ./vendor/spiral/core/src/Container.php:407 { …}
    ./vendor/spiral/core/src/ContainerScope.php:45 { …}
    ./vendor/spiral/core/src/Container.php:402 { …}
    ./vendor/spiral/core/src/Container.php:169 { …}
    /app/harness/php/runner.php:99 { …}
  }
}
@roxblnfk
Copy link
Collaborator

roxblnfk commented Jan 20, 2025

The problem related with temporalio/sdk-php#481

A temporary solution could be to set a unique name for the Workflow to avoid conflicts with Workflows of the same name from other TaskQueues:
https://github.com/temporalio/sdk-php/blob/fc67190d6176f7fb145167d5ad0a2d5273fedf06/tests/Acceptance/Harness/ContinueAsNew/ContinueAsSameTest.php#L44
https://github.com/temporalio/sdk-php/blob/fc67190d6176f7fb145167d5ad0a2d5273fedf06/tests/Acceptance/Harness/ContinueAsNew/ContinueAsSameTest.php#L25
https://github.com/temporalio/sdk-php/blob/fc67190d6176f7fb145167d5ad0a2d5273fedf06/tests/Acceptance/Harness/ContinueAsNew/ContinueAsSameTest.php#L52

With this bug, all Harness tests might be flaky because the Workflow type "Workflow" is used everywhere (but with different TaskQueues) 🤯

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 a pull request may close this issue.

2 participants