Skip to content

feat(extstore): Add support for Nexus task handling - #1676

Open
jmaeagle99 wants to merge 2 commits into
mainfrom
extstore-nexus
Open

feat(extstore): Add support for Nexus task handling#1676
jmaeagle99 wants to merge 2 commits into
mainfrom
extstore-nexus

Conversation

@jmaeagle99

Copy link
Copy Markdown
Contributor

What was changed

  • Add external storage support to Nexus task handling.
  • Use visitor-based codec encode/decode and storage store/retrieve.
  • Drop external_payloads condition from reference check.

Why?

Round out the support for external storage for all task handlers.

Checklist

  1. How was this tested: Integration tests

  2. Any docs updates needed? No

@jmaeagle99
jmaeagle99 requested a review from a team as a code owner July 25, 2026 18:25

def _decode_reference(self, payload: Payload) -> ExternalStorageReference | None:
"""Decode an external storage reference from a payload."""
if len(payload.external_payloads) == 0:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The Nexus task transport drops the external_payloads field. Regardless, it shouldn't be checking for this field anyway and should only rely on the metadata.

):
await asyncio.shield(self._bridge_worker().complete_nexus_task(completion))

async def _encode_completion(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm confused by the lack of decoding. Is that because it was already happening and just didn't do anything since it saw no claims?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Decoding happens in _DummyPayloadSerializer.deserialize.

self._data_converter.payload_converter,
completion.failure,
)
await self._encode_completion(completion)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Would it be possible to fold this step into self._complete_task? The intent of adding that method was to ensure that all locations that complete a task have the same behavior and this seems like it's applied throughout.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

If I did that, then extra fault handling would have to be written. For example, if external storage faulted on the success completion, I'd have to catch that exception, create a failure, attempt to encode and store that failure, and then submit that completion. It would be duplicated exception handling code and might be convoluted to discriminate.

Comment thread temporalio/worker/_nexus.py
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