Title: Performance [P2]: Reuse sandbox registration transport on retries · Issue #188 · microsoft/durabletask-python · GitHub
Open Graph Title: Performance [P2]: Reuse sandbox registration transport on retries · Issue #188 · microsoft/durabletask-python
X Title: Performance [P2]: Reuse sandbox registration transport on retries · Issue #188 · microsoft/durabletask-python
Description: What is the issue? Each retriable sandbox registration failure creates and closes a new gRPC transport, channel, interceptor, and synchronous token manager. What is the impact? Repeated transient failures cause avoidable connection setup...
Open Graph Description: What is the issue? Each retriable sandbox registration failure creates and closes a new gRPC transport, channel, interceptor, and synchronous token manager. What is the impact? Repeated transient f...
X Description: What is the issue? Each retriable sandbox registration failure creates and closes a new gRPC transport, channel, interceptor, and synchronous token manager. What is the impact? Repeated transient f...
Opengraph URL: https://github.com/microsoft/durabletask-python/issues/188
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Performance [P2]: Reuse sandbox registration transport on retries","articleBody":"### What is the issue?\n\nEach retriable sandbox registration failure creates and closes a new gRPC transport, channel, interceptor, and synchronous token manager.\n\n### What is the impact?\n\nRepeated transient failures cause avoidable connection setup and authentication work, extending recovery time and adding load during an outage or unstable network period.\n\n### Details about the issue including code reference\n\nRelevant code:\n\nhttps://github.com/microsoft/durabletask-python/blob/55d8e0b413eb5dd75afa64f30c54fe300bf4ea21/durabletask-azuremanaged/durabletask/azuremanaged/preview/sandboxes/worker.py#L131-L156\n\nhttps://github.com/microsoft/durabletask-python/blob/55d8e0b413eb5dd75afa64f30c54fe300bf4ea21/durabletask-azuremanaged/durabletask/azuremanaged/preview/sandboxes/transport.py#L50-L62\n\nhttps://github.com/microsoft/durabletask-python/blob/55d8e0b413eb5dd75afa64f30c54fe300bf4ea21/durabletask-azuremanaged/durabletask/azuremanaged/internal/durabletask_grpc_interceptor.py#L44-L50\n\n`SandboxWorker._run_sandbox_registration_loop()` creates `SandboxActivitiesGrpcTransport` inside every retry iteration. The transport creates a new channel, stub, and `DTSDefaultClientInterceptorImpl` when no channel is supplied. The synchronous interceptor currently acquires a token during construction.\n\n### A potential or proposed solution\n\nCreate one transport for the registration loop and reuse it across retriable stream failures, closing it when the loop exits. Recreate it only after failures known to leave the channel unusable, while preserving the existing retry backoff, stop signal, and thread-join behavior.\n\n### Cold-start relevance\n\nThis affects the first sandbox registration attempt as well as retries. SandboxWorker first constructs its parent worker, then the registration loop creates a separate SandboxActivitiesGrpcTransport with another synchronous interceptor and token manager. Reusing a transport across retries does not remove that initial duplicate authentication setup; consider sharing compatible channel or authentication state with the parent worker when safe.\n\nRelevant code:\n\nhttps://github.com/microsoft/durabletask-python/blob/55d8e0b413eb5dd75afa64f30c54fe300bf4ea21/durabletask-azuremanaged/durabletask/azuremanaged/preview/sandboxes/worker.py#L43-L64\n\nhttps://github.com/microsoft/durabletask-python/blob/55d8e0b413eb5dd75afa64f30c54fe300bf4ea21/durabletask-azuremanaged/durabletask/azuremanaged/preview/sandboxes/worker.py#L131-L144","author":{"url":"https://github.com/berndverst","@type":"Person","name":"berndverst"},"datePublished":"2026-07-24T20:50:21Z","url":"https://github.com/microsoft/durabletask-python/issues/188"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:e1cdb12e-5dbe-acc8-d4b5-65d106f960df |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C6A6:30C434:D7E3C:123AD4:6AFE44AE |
| html-safe-nonce | cd8025bd93a3c4525018f938ecd63d2e190ef558b303ac939fa27d8f84e65af1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNkE2OjMwQzQzNDpEN0UzQzoxMjNBRDQ6NkFGRTQ0QUUiLCJ2aXNpdG9yX2lkIjoiMTk2MTk5MTUwNjk5ODc0MDE0MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | b97a32e7c6b3b44b86543d5675435d034d41697a4f16d81776aa453494e3aac2 |
| hovercard-subject-tag | issue:4971936625 |
| 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/microsoft/durabletask-python/188/issue_layout |
| twitter:image | https://opengraph.githubassets.com/75f4329b1dce849ff73f4d0765716807102a28176db3b68cdc21409aecb32240/microsoft/durabletask-python/issues/188 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/75f4329b1dce849ff73f4d0765716807102a28176db3b68cdc21409aecb32240/microsoft/durabletask-python/issues/188 |
| og:image:alt | What is the issue? Each retriable sandbox registration failure creates and closes a new gRPC transport, channel, interceptor, and synchronous token manager. What is the impact? Repeated transient f... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | berndverst |
| hostname | github.com |
| expected-hostname | github.com |
| None | f1a5901e2377b0af2a0b303f9528678f1475d04b9219dca1e993344196eaa07c |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/durabletask-python git https://github.com/microsoft/durabletask-python.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 627664515 |
| octolytics-dimension-repository_nwo | microsoft/durabletask-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 627664515 |
| octolytics-dimension-repository_network_root_nwo | microsoft/durabletask-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 | ce393ea11ad276623b946bc9663d3e7d6f564275 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width