Skip to content

Commit 8e94f9c

Browse files
committed
skip indexing retry fx
1 parent 0f9974d commit 8e94f9c

1 file changed

Lines changed: 39 additions & 39 deletions

File tree

  • workers/tests/emulator_tests/eventhub_functions/eventhub_retry_stein

workers/tests/emulator_tests/eventhub_functions/eventhub_retry_stein/function_app.py

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -21,50 +21,50 @@ def eventhub_retry_output(req: func.HttpRequest, event: func.Out[str]):
2121

2222

2323
# EventHub trigger with exponential backoff retry policy (no explicit intervals)
24-
@app.function_name(name="eventhub_retry_trigger")
25-
@app.retry(
26-
strategy="exponential_backoff",
27-
max_retry_count="3"
28-
# Note: minimum_interval and maximum_interval are optional
29-
# and will use default values if not specified
30-
)
31-
@app.event_hub_message_trigger(
32-
arg_name="event",
33-
event_hub_name="python-worker-ci-eventhub-retry",
34-
connection="AzureWebJobsEventHubConnectionString"
35-
)
36-
@app.blob_output(arg_name="$return",
37-
path="python-worker-tests/test-eventhub-retry-triggered.txt",
38-
connection="AzureWebJobsStorage")
39-
def eventhub_retry_trigger(event: func.EventHubEvent, context: func.Context) -> bytes:
40-
event_id = event.get_body().decode('utf-8')
41-
retry_count = context.retry_context.retry_count if context.retry_context else 0
42-
max_retry = context.retry_context.max_retry_count if context.retry_context else 0
24+
# @app.function_name(name="eventhub_retry_trigger")
25+
# @app.retry(
26+
# strategy="exponential_backoff",
27+
# max_retry_count="3"
28+
# # Note: minimum_interval and maximum_interval are optional
29+
# # and will use default values if not specified
30+
# )
31+
# @app.event_hub_message_trigger(
32+
# arg_name="event",
33+
# event_hub_name="python-worker-ci-eventhub-retry",
34+
# connection="AzureWebJobsEventHubConnectionString"
35+
# )
36+
# @app.blob_output(arg_name="$return",
37+
# path="python-worker-tests/test-eventhub-retry-triggered.txt",
38+
# connection="AzureWebJobsStorage")
39+
# def eventhub_retry_trigger(event: func.EventHubEvent, context: func.Context) -> bytes:
40+
# event_id = event.get_body().decode('utf-8')
41+
# retry_count = context.retry_context.retry_count if context.retry_context else 0
42+
# max_retry = context.retry_context.max_retry_count if context.retry_context else 0
4343

44-
logging.info(f'EventHub retry trigger processed event: {event_id}, '
45-
f'retry count: {retry_count}, max retry: {max_retry}')
44+
# logging.info(f'EventHub retry trigger processed event: {event_id}, '
45+
# f'retry count: {retry_count}, max retry: {max_retry}')
4646

47-
# Track retry attempts
48-
if event_id not in retry_attempts:
49-
retry_attempts[event_id] = []
50-
retry_attempts[event_id].append(retry_count)
47+
# # Track retry attempts
48+
# if event_id not in retry_attempts:
49+
# retry_attempts[event_id] = []
50+
# retry_attempts[event_id].append(retry_count)
5151

52-
# Create result dictionary
53-
result = {
54-
'event_id': event_id,
55-
'retry_count': retry_count,
56-
'max_retry_count': max_retry,
57-
'all_attempts': retry_attempts[event_id]
58-
}
52+
# # Create result dictionary
53+
# result = {
54+
# 'event_id': event_id,
55+
# 'retry_count': retry_count,
56+
# 'max_retry_count': max_retry,
57+
# 'all_attempts': retry_attempts[event_id]
58+
# }
5959

60-
# Fail on first two attempts to test retry
61-
if retry_count < 2:
62-
logging.warning(f'Simulating failure for retry test (attempt {retry_count})')
63-
raise Exception(f"Simulated failure for retry testing (attempt {retry_count})")
60+
# # Fail on first two attempts to test retry
61+
# if retry_count < 2:
62+
# logging.warning(f'Simulating failure for retry test (attempt {retry_count})')
63+
# raise Exception(f"Simulated failure for retry testing (attempt {retry_count})")
6464

65-
# Success on third attempt
66-
logging.info(f'Success on attempt {retry_count}')
67-
return json.dumps(result).encode('utf-8')
65+
# # Success on third attempt
66+
# logging.info(f'Success on attempt {retry_count}')
67+
# return json.dumps(result).encode('utf-8')
6868

6969

7070
# Retrieve the event data from storage blob and return it as Http response

0 commit comments

Comments
 (0)