Skip to content

Commit 6972d8a

Browse files
committed
chore: naming
1 parent a21c94d commit 6972d8a

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

packages/serverless/src/backend_connector.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@ const layerExtensionPort = process.env.INSTANA_LAYER_EXTENSION_PORT
2020
const timeoutEnvVar = 'INSTANA_TIMEOUT';
2121

2222
// NOTE: The heartbeat is usually really, really fast (<30ms).
23-
const heartbeatTimeout = 200;
23+
const layerExtensionHeartbeatTimeout = 200;
2424

2525
// NOTE: The initial heartbeat can be very slow when the Lambda is in cold start.
26-
const initialHeartbeatTimeout = 2000;
26+
const initialLayerExtensionHeartbeatTimeout = 2000;
2727

2828
// NOTE: When lambda is in cold start, the communication between the handler
2929
// and the extension can take a while. We need to have a bigger timeout
3030
// for the initially.
31-
const initialLayerExtensionTimeout = 2000;
31+
const initialLayerExtensionRequestTimeout = 2000;
3232

33-
const layerExtensionTimeout = process.env.INSTANA_LAMBDA_EXTENSION_TIMEOUT_IN_MS
33+
const layerExtensionRequestTimeout = process.env.INSTANA_LAMBDA_EXTENSION_TIMEOUT_IN_MS
3434
? Number(process.env.INSTANA_LAMBDA_EXTENSION_TIMEOUT_IN_MS)
3535
: 500;
3636

@@ -208,7 +208,7 @@ function scheduleLambdaExtensionHeartbeatRequest(heartbeatOpts = {}) {
208208
});
209209

210210
// CASE: socket is open but no data is sent (should not happen from we know but we need to handle it)
211-
req.setTimeout(heartbeatTimeout, () => {
211+
req.setTimeout(layerExtensionHeartbeatTimeout, () => {
212212
// req.destroyed indicates that we have run into a timeout and have already handled the timeout error.
213213
if (req.destroyed) {
214214
return;
@@ -225,10 +225,10 @@ function scheduleLambdaExtensionHeartbeatRequest(heartbeatOpts = {}) {
225225

226226
// call immediately
227227
// timeout is bigger because of possible coldstart
228-
executeHeartbeat({ heartbeatTimeout: initialHeartbeatTimeout });
228+
executeHeartbeat({ heartbeatTimeout: initialLayerExtensionHeartbeatTimeout });
229229

230230
heartbeatInterval = setInterval(() => {
231-
executeHeartbeat({ heartbeatTimeout: heartbeatTimeout });
231+
executeHeartbeat({ heartbeatTimeout: layerExtensionHeartbeatTimeout });
232232
}, 300);
233233

234234
heartbeatInterval.unref();
@@ -247,9 +247,9 @@ function getBackendTimeout(localUseLambdaExtension) {
247247
if (localUseLambdaExtension) {
248248
if (firstRequestToExtension) {
249249
firstRequestToExtension = false;
250-
return initialLayerExtensionTimeout;
250+
return initialLayerExtensionRequestTimeout;
251251
} else {
252-
return layerExtensionTimeout;
252+
return layerExtensionRequestTimeout;
253253
}
254254
}
255255

0 commit comments

Comments
 (0)