Skip to content

Commit 6a58bce

Browse files
committed
Merge remote-tracking branch 'origin/main' into onzia/bump-pytest
2 parents 402688b + 5b292db commit 6a58bce

3 files changed

Lines changed: 9 additions & 11 deletions

File tree

datadog_lambda/config.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,11 @@ def _reset(self):
141141
"enabled" if config.fips_mode_enabled else "not enabled",
142142
)
143143

144+
# Remote configuration relies on /dev/shm which is unavailable in Lambda.
145+
# Disable it before ddtrace loads to avoid the shared-memory warning.
146+
if "DD_REMOTE_CONFIGURATION_ENABLED" not in os.environ:
147+
os.environ["DD_REMOTE_CONFIGURATION_ENABLED"] = "false"
148+
144149
# disable css to prevent double counting in lambda
145150
os.environ["DD_TRACE_STATS_COMPUTATION_ENABLED"] = "false"
146151

datadog_lambda/durable.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def extract_durable_function_tags(event):
5555
}
5656

5757

58-
VALID_DURABLE_STATUSES = {"SUCCEEDED", "FAILED", "STOPPED", "TIMED_OUT"}
58+
VALID_DURABLE_STATUSES = {"SUCCEEDED", "FAILED", "PENDING"}
5959

6060

6161
def extract_durable_execution_status(response, event):

tests/test_durable.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -131,19 +131,12 @@ def test_returns_failed(self):
131131
response = {"Status": "FAILED", "Error": "some-error"}
132132
self.assertEqual(extract_durable_execution_status(response, event), "FAILED")
133133

134-
def test_returns_stopped(self):
134+
def test_returns_pending(self):
135135
event = {
136136
"DurableExecutionArn": "arn:aws:lambda:us-east-1:123:function:f:1/durable-execution/n/id"
137137
}
138-
response = {"Status": "STOPPED"}
139-
self.assertEqual(extract_durable_execution_status(response, event), "STOPPED")
140-
141-
def test_returns_timed_out(self):
142-
event = {
143-
"DurableExecutionArn": "arn:aws:lambda:us-east-1:123:function:f:1/durable-execution/n/id"
144-
}
145-
response = {"Status": "TIMED_OUT"}
146-
self.assertEqual(extract_durable_execution_status(response, event), "TIMED_OUT")
138+
response = {"Status": "PENDING"}
139+
self.assertEqual(extract_durable_execution_status(response, event), "PENDING")
147140

148141
def test_returns_none_for_non_durable_event(self):
149142
event = {"key": "value"}

0 commit comments

Comments
 (0)