Skip to content

Python functions shut down slowly #109

@fernandezcuesta

Description

@fernandezcuesta

What happened?

I'm not fully sure where to report this, but the point is that after introducing a composition function developed with python, we noticed that:

  • The latency of the function deployment to do a rollout restart is way larger than others (e.g. based on go sdk)
  • The amount of time it takes for crossplane render got penalized as well.

This is negatively impacting both CI and DevEx since rendering a composition is quite a common use case.

How can we reproduce it?

I just tested this with a dummy function which does nothing:

    async def RunFunction(
        self, req: fnv1.RunFunctionRequest, _: grpc.aio.ServicerContext
    ) -> fnv1.RunFunctionResponse:
        """Run the function."""
        log = self.log.bind(tag=req.meta.tag)
        log.info("Running function and doing nothing")

        return response.to(req)

Running crossplane render on a composition that has this function as a dependency (not necessarily used in the pipeline, just declaring this as a dependency in crossplane.yaml is enough) adds an extra ~10s. A couple of experiments with simple compositions raise the amount of time for the render command from 1-2 seconds to 10-12 seconds.

I was suspecting that this could have something to do, and played by setting it to None but apparently didn't help :(

What environment did it happen in?

function-sdk-python version: 0.5.0
crank version v1.18.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