Skip to content

Conversation

@maxdml
Copy link
Collaborator

@maxdml maxdml commented Aug 21, 2025

also:

  • set max/min conns and timeouts on sysdb pool
  • fix a small race in a test, remove unused code

Comment on lines +802 to +810
// Validate input parameters
if input.rowsThreshold != nil && *input.rowsThreshold <= 0 {
return fmt.Errorf("rowsThreshold must be greater than 0, got %d", *input.rowsThreshold)
}
Copy link
Collaborator Author

@maxdml maxdml Aug 21, 2025

Choose a reason for hiding this comment

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

Technically this could be enforced by using a unsigned integer, but I trust this makes for a better error message.

Comment on lines +847 to +862
// Signal the child workflow is started
pollingHandleStartEvent.Set()

result, err := childHandle.GetResult()
if err != nil {
return "", fmt.Errorf("failed to get result from child workflow: %w", err)
}
return result, nil
case 2:
// Second handle will be a polling handle
_, ok := childHandle.(*workflowPollingHandle[string])
if !ok {
return "", fmt.Errorf("expected recovered child handle to be of type workflowPollingHandle, got %T", childHandle)
}
}

// Signal the child workflow is started
pollingHandleStartEvent.Set()

result, err := childHandle.GetResult()
if err != nil {
return "", fmt.Errorf("failed to get result from child workflow: %w", err)
}
return result, nil
return "", nil
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There is an interesting race here.

This test calls the workflow twice, then eventually waits on the workflow result before completing. After completion, tests call a cleanup function that calls Shutdown.

It is possible that the 2nd invocation of the workflow (typically the one where the child gets a polling handle) completes slow enough that the test is already in the cleanup phase.

This will result in a segfault, given that Shutdown clears the system DB.

Because this test just wants to verify the 2nd invocation of the child gets a polling handle, we can simply do the GetResult() on the first call only.

Comment on lines -953 to -971
var blockingStepStopEvent *Event

func blockingStep(_ context.Context) (string, error) {
blockingStepStopEvent.Wait()
return "", nil
}

var idempotencyWorkflowWithStepEvent *Event

func idempotencyWorkflowWithStep(dbosCtx DBOSContext, input string) (int64, error) {
RunAsStep(dbosCtx, func(ctx context.Context) (int64, error) {
return incrementCounter(ctx, int64(1))
})
idempotencyWorkflowWithStepEvent.Set()
RunAsStep(dbosCtx, func(ctx context.Context) (string, error) {
return blockingStep(ctx)
})
return idempotencyCounter, nil
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

unused

Base automatically changed from shutdown-cancel-ux to main August 21, 2025 21:04
@maxdml maxdml marked this pull request as ready for review August 21, 2025 21:05
Copy link
Member

@kraftp kraftp left a comment

Choose a reason for hiding this comment

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

Great! We'll also need to add Go to the Cloud GC tests

@maxdml maxdml merged commit 60907cf into main Aug 21, 2025
2 checks passed
@maxdml maxdml deleted the gc-gt branch August 21, 2025 21:17
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.

3 participants