Skip to content

Commit bd2dc82

Browse files
committed
Extending execution context for retries
1 parent df7a92b commit bd2dc82

File tree

8 files changed

+29
-5
lines changed

8 files changed

+29
-5
lines changed

Worker.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
33
<metadata>
44
<id>Microsoft.Azure.Functions.NodeJsWorker</id>
5-
<version>2.1.0$version$</version>
5+
<version>2.1.1$version$</version>
66
<authors>Microsoft</authors>
77
<owners>Microsoft</owners>
88
<requireLicenseAcceptance>false</requireLicenseAcceptance>

azure-functions-language-worker-protobuf/src/proto/FunctionRpc.proto

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,12 @@ message InvocationRequest {
263263

264264
// Populates activityId, tracestate and tags from host
265265
RpcTraceContext trace_context = 5;
266+
267+
// current retry count
268+
int32 retry_count = 6;
269+
270+
// max retry count
271+
int32 max_retry_count = 7;
266272
}
267273

268274
// Host sends ActivityId, traceStateString and Tags from host

azure-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
variables: {
2-
WORKER_VERSION: '2.1.0',
2+
WORKER_VERSION: '2.1.1',
33
NODE_8: '8.x',
44
NODE_10: '10.x',
55
NODE_12: '12.x',

e2e-nightly-cli-azure-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
variables: {
2-
WORKER_VERSION: '2.1.0',
2+
WORKER_VERSION: '2.1.1',
33
NODE_12: '12.x'
44
}
55
name: $(WORKER_VERSION)-$(Date:yyyyMMdd)$(Rev:.r)

e2e-nightly-site-azure-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
variables: {
2-
WORKER_VERSION: '2.1.0',
2+
WORKER_VERSION: '2.1.1',
33
NODE_12: '12.x'
44
}
55
name: $(WORKER_VERSION)-$(Date:yyyyMMdd)$(Rev:.r)

src/Context.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ class InvocationContext implements Context {
7575
const executionContext = {
7676
invocationId: this.invocationId,
7777
functionName: <string>info.name,
78-
functionDirectory: <string>info.directory
78+
functionDirectory: <string>info.directory,
79+
retryCount: <number>request.retryCount,
80+
maxRetryCount: <number>request.maxRetryCount
7981
};
8082
this.executionContext = executionContext;
8183
this.bindings = {};

src/public/Interfaces.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,14 @@ export interface ExecutionContext {
157157
* The directory your function is in (this is the parent directory of this function's function.json).
158158
*/
159159
functionDirectory: string;
160+
/**
161+
* Current retry count.
162+
*/
163+
retryCount: number;
164+
/**
165+
* Current retry count.
166+
*/
167+
maxRetryCount: number;
160168
}
161169

162170
/**

types/public/Interfaces.d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,14 @@ export interface ExecutionContext {
155155
* The directory your function is in (this is the parent directory of this function's function.json).
156156
*/
157157
functionDirectory: string;
158+
/**
159+
* Current retry count.
160+
*/
161+
retryCount: number;
162+
/**
163+
* Current retry count.
164+
*/
165+
maxRetryCount: number;
158166
}
159167
/**
160168
* TraceContext information to enable distributed tracing scenarios.

0 commit comments

Comments
 (0)