Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

## 4.22.0

- A failed cluster-info read no longer stops a running worker. Startup
discovery (query-task authority, Nexus cooperation) and the inline-payload
policy read before a report retry a connection failure, timeout, 5xx or 429
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "durable-workflow"
version = "4.21.0"
version = "4.22.0"
edition = "2021"
description = "Rust client and worker SDK for Durable Workflow Cloud and self-hosted Server"
license = "MIT"
Expand All @@ -14,7 +14,7 @@ categories = ["api-bindings", "asynchronous"]
include = ["/src/**", "/schema/**", "/examples/**", "/Cargo.toml", "/README.md", "/CHANGELOG.md", "/LICENSE", "/tests/fixtures/replay-regressions/published-php-complete-explicit-backoff.json", "/tests/fixtures/sdk-metrics-contract.json", "/tests/fixtures/workflow-task-completion-limits-v1-vectors.json", "/tests/fixtures/auth-configuration/static-credentials-v1.json"]

[package.metadata.durable-workflow]
product-train = "4.21.0"
product-train = "4.22.0"
compatibility-authority = "protocol-manifests"
supported-server-versions = "2.0.0"
supported-server-release-baselines = { "2" = "2.0.0", "3" = "3.0.2" }
Expand Down
11 changes: 8 additions & 3 deletions scripts/acceptance/installed-native/proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
is held for that many seconds before forwarding, unchanged, so a run or
execution deadline passes while the worker waits for the receipt.
"""
import http.client, http.server, json, pathlib, re, threading, time
import gzip, http.client, http.server, json, pathlib, re, threading, time

state = pathlib.Path('/state')
lock = threading.Lock()

# Response headers the SDK reads from the native Server; anything else is dropped.
FORWARDED_HEADERS = {
'content-encoding': 'Content-Encoding',
'content-type': 'Content-Type',
'retry-after': 'Retry-After',
'x-durable-workflow-control-plane-version': 'X-Durable-Workflow-Control-Plane-Version',
Expand Down Expand Up @@ -65,20 +66,24 @@ def handle_request(self):
headers = {k: v for k, v in self.headers.items() if k.lower() not in ('host', 'connection')}
connection.request(self.command, self.path, body=raw, headers=headers)
response = connection.getresponse()
response_headers = forwardable_headers(response.getheaders())
body = response.read()
if self.path.endswith(('/fail', '/complete')) and '/workflow-tasks/' in self.path:
receipt = body
if response.getheader('Content-Encoding', '').strip().lower() == 'gzip':
receipt = gzip.decompress(body)
event = {
'time': time.time(), 'path': self.path, 'status': response.status,
'delay_seconds': delayed,
'request_attempt': request.get('workflow_task_attempt'),
'failure_type': request.get('failure', {}).get('type'),
'response': {k: v for k, v in json.loads(body).items() if k != 'server_capabilities'},
'response': {k: v for k, v in json.loads(receipt).items() if k != 'server_capabilities'},
}
with lock:
with (state / 'acks.jsonl').open('a') as log:
log.write(json.dumps(event) + '\n')
self.send_response(response.status)
for key, value in forwardable_headers(response.getheaders()):
for key, value in response_headers:
self.send_header(key, value)
self.send_header('Content-Length', str(len(body)))
self.send_header('Connection', 'close')
Expand Down
3 changes: 3 additions & 0 deletions scripts/acceptance/installed-native/test_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class ForwardableHeadersTest(unittest.TestCase):
def test_relays_only_the_reviewed_set(self):
relayed = forwardable_headers([
('Content-Type', 'application/json'),
('Content-Encoding', 'gzip'),
('X-Durable-Workflow-Protocol-Version', '1.20'),
('Retry-After', '1'),
('Connection', 'keep-alive'),
Expand All @@ -22,6 +23,7 @@ def test_relays_only_the_reviewed_set(self):
])
self.assertEqual(relayed, [
('Content-Type', 'application/json'),
('Content-Encoding', 'gzip'),
('X-Durable-Workflow-Protocol-Version', '1.20'),
('Retry-After', '1'),
])
Expand All @@ -31,6 +33,7 @@ def test_reviewed_set_is_exact(self):
# this set needs review; request-only names such as
# x-durable-workflow-payload-completion must not be relayed.
self.assertEqual(frozenset(FORWARDED_HEADERS), frozenset((
'content-encoding',
'content-type',
'retry-after',
'x-durable-workflow-control-plane-version',
Expand Down
Loading