Skip to content

Commit 361e79c

Browse files
authored
Merge pull request #1138 from OpenFn/disable-retry
Disable worker retry stuff
2 parents a8f19b1 + c381dd0 commit 361e79c

5 files changed

Lines changed: 17 additions & 5 deletions

File tree

packages/ws-worker/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# ws-worker
22

3+
## 1.19.5
4+
5+
### Patch Changes
6+
7+
- b42b0b0: Force disable message retries
8+
39
## 1.19.4
410

511
### Patch Changes

packages/ws-worker/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@openfn/ws-worker",
3-
"version": "1.19.4",
3+
"version": "1.19.5",
44
"description": "A Websocket Worker to connect Lightning to a Runtime Engine",
55
"main": "dist/index.js",
66
"type": "module",

packages/ws-worker/src/start.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ function engineReady(engine: any) {
5353
timeoutRetryDelayMs: args.timeoutRetryDelayMs,
5454
};
5555

56-
if ('socketTimeoutSeconds' in args) {
56+
if (args.socketTimeoutSeconds) {
5757
logger.warn(
5858
'WARNING: deprecated socketTimeoutSeconds value passed.\n\nThis will be respected as the default socket timeout value, but will be removed from future versions of the worker.'
5959
);

packages/ws-worker/src/util/send-event.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ import * as Sentry from '@sentry/node';
22
import type { Context } from '../api/execute';
33
import { LightningSocketError, LightningTimeoutError } from '../errors';
44

5+
// Force disabled for now because this can cause duplication on the Lightning end
6+
// See https://github.com/OpenFn/kit/issues/1137
7+
const allowRetryOntimeout = false;
8+
59
export const sendEvent = <T>(
610
context: Pick<Context, 'logger' | 'channel' | 'id' | 'options'>,
711
event: string,
@@ -48,7 +52,7 @@ export const sendEvent = <T>(
4852
report(new LightningSocketError(event, message));
4953
})
5054
.receive('timeout', () => {
51-
if (thisAttempt >= timeoutRetryCount) {
55+
if (!allowRetryOntimeout || thisAttempt >= timeoutRetryCount) {
5256
report(new LightningTimeoutError(event));
5357
} else {
5458
logger.warn(

packages/ws-worker/test/util/send-event.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ test.serial('should throw if the event timesout and retry is 1', async (t) => {
114114
t.is(events.length, 0);
115115
});
116116

117-
test.serial(
117+
// This behaviour is disabled and this test will likely be removed soon
118+
test.serial.skip(
118119
'should throw after 5 attempts if the event timesout and retry is 5',
119120
async (t) => {
120121
const EVENT_NAME = 'test';
@@ -147,7 +148,8 @@ test.serial(
147148
}
148149
);
149150

150-
test.serial(
151+
// This behaviour is disabled and this test will likely be removed soon
152+
test.serial.skip(
151153
'should pass after 5 attempts if the event timesout and retry is 5',
152154
async (t) => {
153155
let count = 0;

0 commit comments

Comments
 (0)