Title: Python functions shut down slowly · Issue #109 · crossplane/function-sdk-python · GitHub
Open Graph Title: Python functions shut down slowly · Issue #109 · crossplane/function-sdk-python
X Title: Python functions shut down slowly · Issue #109 · crossplane/function-sdk-python
Description: 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 t...
Open Graph Description: 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...
X Description: 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 deploy...
Opengraph URL: https://github.com/crossplane/function-sdk-python/issues/109
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Python functions shut down slowly","articleBody":"### What happened?\r\n\r\nI'm not fully sure where to report this, but the point is that after introducing a composition function developed with python, we noticed that:\r\n- The latency of the function deployment to do a rollout restart is way larger than others (e.g. based on go sdk)\r\n- The amount of time it takes for `crossplane render` got penalized as well.\r\n\r\nThis is negatively impacting both CI and DevEx since rendering a composition is quite a common use case.\r\n\r\n### How can we reproduce it?\r\n\r\nI just tested this with a dummy function which does nothing:\r\n\r\n```python\r\n async def RunFunction(\r\n self, req: fnv1.RunFunctionRequest, _: grpc.aio.ServicerContext\r\n ) -\u003e fnv1.RunFunctionResponse:\r\n \"\"\"Run the function.\"\"\"\r\n log = self.log.bind(tag=req.meta.tag)\r\n log.info(\"Running function and doing nothing\")\r\n\r\n return response.to(req)\r\n```\r\n\r\nRunning `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.\r\n\r\nI was suspecting that [this](https://github.com/crossplane/function-sdk-python/blob/main/crossplane/function/runtime.py#L119) could have something to do, and played by setting it to `None` but apparently didn't help :(\r\n\r\n### What environment did it happen in?\r\nfunction-sdk-python version: 0.5.0\r\ncrank version v1.18.0\r\n\r\n","author":{"url":"https://github.com/fernandezcuesta","@type":"Person","name":"fernandezcuesta"},"datePublished":"2024-11-15T13:02:38.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/109/function-sdk-python/issues/109"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a0bc8e94-85ce-e0a8-928c-be3149ef65b4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C120:1DB01:2DF550:3E70CB:6A61641D |
| html-safe-nonce | a1fe602cd44a13728742bc2d771169f47610df0c40c200bcd9387d9a846034b1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMTIwOjFEQjAxOjJERjU1MDozRTcwQ0I6NkE2MTY0MUQiLCJ2aXNpdG9yX2lkIjoiMzA1NDE3NzY4MTQ5NDA3NDM5NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | bad2194b3aa184eea24693307dc3cae5c6d8b32a963be64d2284eae296ad1e4c |
| hovercard-subject-tag | issue:2661895711 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/crossplane/function-sdk-python/109/issue_layout |
| twitter:image | https://opengraph.githubassets.com/03762ece40aca089dd84127b228fbe02de246c1677900c3b72d12de294b510eb/crossplane/function-sdk-python/issues/109 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/03762ece40aca089dd84127b228fbe02de246c1677900c3b72d12de294b510eb/crossplane/function-sdk-python/issues/109 |
| og:image:alt | 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... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | fernandezcuesta |
| hostname | github.com |
| expected-hostname | github.com |
| None | c258d2b06b498220e3b94af28b26bbbf58f4203a6373725f779afcc867afd263 |
| turbo-cache-control | no-preview |
| go-import | github.com/crossplane/function-sdk-python git https://github.com/crossplane/function-sdk-python.git |
| octolytics-dimension-user_id | 45158470 |
| octolytics-dimension-user_login | crossplane |
| octolytics-dimension-repository_id | 721365259 |
| octolytics-dimension-repository_nwo | crossplane/function-sdk-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 721365259 |
| octolytics-dimension-repository_network_root_nwo | crossplane/function-sdk-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 5f67bc431418961e0814f1eb30a4231250e4726d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width