Skip to content

Commit bdc8c86

Browse files
committed
v6.7.1 - Don't always reboot worker if broker crashes
1 parent ea19ad3 commit bdc8c86

File tree

5 files changed

+9
-7
lines changed

5 files changed

+9
-7
lines changed

index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ SocketCluster.prototype._init = function (options) {
108108
tcpSynBacklog: null,
109109
workerController: null,
110110
brokerController: null,
111+
brokerConnectRetryErrorThreshold: null,
111112
initController: null,
112113
rebootOnSignal: true,
113114
downgradeToUser: false,

kubernetes/socketcluster-deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ spec:
1111
spec:
1212
containers:
1313
- name: socketcluster
14-
image: socketcluster/socketcluster:v6.7.0
14+
image: socketcluster/socketcluster:v6.7.1
1515
ports:
1616
- containerPort: 8000
1717
env:

lib/scworker.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ SCWorker.prototype._init = function (options) {
9595
this.brokerEngineClient = new this.brokerEngine.Client({
9696
brokers: this.options.brokers,
9797
secretKey: this.options.secretKey,
98-
pubSubBatchDuration: this.options.pubSubBatchDuration
98+
pubSubBatchDuration: this.options.pubSubBatchDuration,
99+
connectRetryErrorThreshold: this.options.brokerConnectRetryErrorThreshold
99100
});
100101

101102
this.brokerEngineClient.on('error', function (err) {
@@ -107,8 +108,8 @@ SCWorker.prototype._init = function (options) {
107108
}
108109
self._errorDomain.emit('error', error);
109110
});
110-
this.brokerEngineClient.on('warning', function () {
111-
self.warningHandler.apply(self, arguments);
111+
this.brokerEngineClient.on('warning', function (warning) {
112+
self.warningHandler(warning);
112113
});
113114
this.exchange = this.global = this.brokerEngineClient.exchange();
114115

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "socketcluster",
33
"description": "SocketCluster - A Highly parallelized WebSocket server cluster to make the most of multi-core machines/instances.",
4-
"version": "6.7.0",
4+
"version": "6.7.1",
55
"homepage": "http://socketcluster.io",
66
"contributors": [
77
{
@@ -20,7 +20,7 @@
2020
"inquirer": "1.1.3",
2121
"minimist": "1.1.0",
2222
"sc-auth": "~4.1.1",
23-
"sc-broker-cluster": "~4.2.0",
23+
"sc-broker-cluster": "~4.2.2",
2424
"sc-domain": "~1.0.1",
2525
"sc-emitter": "~1.1.0",
2626
"sc-errors": "~1.3.3",

sample/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"sc-hot-reboot": "~1.0.0",
1919
"scc-broker-client": "~1.4.0",
2020
"serve-static": "1.11.2",
21-
"socketcluster": "~6.7.0",
21+
"socketcluster": "~6.7.1",
2222
"socketcluster-client": "~6.3.0"
2323
},
2424
"keywords": [

0 commit comments

Comments
 (0)