Skip to content

Commit d9f2e2f

Browse files
committed
fix: downgrade transient PubSub poll errors from error to warn
ETIMEDOUT and similar network errors are expected for long-polling connections to Google Pub/Sub. Downgrade these to warn level so they no longer appear in Bugsnag, and return instead of throwing so the poll loop restarts immediately without the 3s error delay.
1 parent 43f2a74 commit d9f2e2f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/oauth/pubsub/google.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,11 @@ class PubSubInstance {
202202

203203
await oauth2Apps.setMeta(this.app, { pubSubFlag: null });
204204
} catch (err) {
205+
// Transient network errors are expected for long-polling connections
206+
if (['ETIMEDOUT', 'ECONNRESET', 'ECONNREFUSED', 'UND_ERR_SOCKET', 'UND_ERR_CONNECT_TIMEOUT'].includes(err.code)) {
207+
logger.warn({ msg: 'Transient error pulling subscription messages', app: this.app, code: err.code });
208+
return;
209+
}
205210
logger.error({ msg: 'Failed to pull subscription messages', app: this.app, err });
206211
throw err;
207212
}

0 commit comments

Comments
 (0)