Skip to content

Function execution fails in directory mode but succeeds individually — likely concurrency/startup timing issue #59

@ronak-701685

Description

@ronak-701685

What happened?

When using crossplane-diff in directory mode (i.e. pointing to a directory of rendered XR files), most resources fail with Function runtime startup errors. However, running the same individual files one by one succeeds consistently.

Example directory: xr-epd
Namespace: vgtrace

Command (failing):

crossplane-diff diff -n vgtrace xr-epd

Command (succeeds for same resource):

crossplane-diff diff -n vgtrace xr-epd/vgtrace-queue.yaml

Errors observed (summarized from logs/screenshot):

cannot start Function 'function-go-templating': open /var/run/docker.sock: connect: no such file or directory
context deadline exceeded

This seems to affect several XRs only when invoked together (directory mode), but they succeed individually — even immediately after failing as part of the bulk run.

⚠️ The error output is also misleading — it lists "unable to process" for XRs that would otherwise succeed.

How can we reproduce it?

  1. Split rendered XRs into a directory, each file containing one CompositeResource (e.g., xr-epd/*.yaml with one XSQSQueue each).

  2. Ensure the function-go-templating function is installed and uses a runtime that cold-starts (e.g., Docker).

  3. Run:

    crossplane-diff diff -n vgtrace xr-epd
  4. Observe multiple function startup errors and unable to process messages.

  5. Immediately pick one of the "failing" files and run it individually:

    crossplane-diff diff -n vgtrace xr-epd/<failing-file>.yaml
  6. It succeeds.

Hypothesis: Directory mode triggers many simultaneous function invocations. If these functions are not already warm (e.g., Docker containers cold-starting), this causes startup delays and timeouts, leading to false negatives. Individual execution avoids the concurrency problem.

What environment did it happen in?

Crossplane version: v2.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions