Skip to content

Commit 47b121c

Browse files
committed
Merge branches 'w/8.1/improvement/ARSN-21-Upgrade-Node-to-16' and 'q/1649/7.10/improvement/ARSN-21-Upgrade-Node-to-16' into tmp/octopus/q/8.1
3 parents 86e3c02 + c605c1e + e7869d8 commit 47b121c

8 files changed

Lines changed: 568 additions & 95 deletions

File tree

.github/workflows/tests.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ jobs:
2828
uses: actions/checkout@v2
2929
- uses: actions/setup-node@v2
3030
with:
31-
node-version: '10'
31+
node-version: '16'
3232
cache: 'yarn'
3333
- name: install dependencies
34-
run: yarn install --frozen-lockfile
34+
run: yarn cache clean && yarn install --frozen-lockfile
3535
- name: lint yaml
3636
run: yarn --silent lint_yml
3737
- name: lint javascript

lib/network/probe/HealthProbeServer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ class HealthProbeServer extends httpServer {
3838
const log = this.logging.newRequestLogger();
3939
log.debug('request received', { method: req.method,
4040
url: req.url });
41+
4142
if (req.method !== 'GET') {
4243
sendError(res, log, errors.MethodNotAllowed);
43-
}
44-
if (req.url in this._reqHandlers) {
44+
} else if (req.url in this._reqHandlers) {
4545
this._reqHandlers[req.url](req, res, log);
4646
} else {
4747
sendError(res, log, errors.InvalidURI);

lib/storage/data/file/DataFileStore.js

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -256,18 +256,15 @@ class DataFileStore {
256256
{ method: 'put', key, filePath, error: err });
257257
// destroying the write stream forces a close(fd)
258258
fileStream.destroy();
259+
// we need to unlink the file ourselves
260+
fs.stat(filePath, err => {
261+
if (!err) {
262+
fs.unlinkSync(filePath);
263+
}
264+
});
259265
return cbOnce(errors.InternalError.customizeDescription(
260266
`read stream error: ${err.code}`));
261267
});
262-
dataStream.on('close', () => {
263-
// this means the underlying socket has been closed
264-
log.debug('Client closed socket while streaming',
265-
{ method: 'put', key, filePath });
266-
// destroying the write stream forces a close(fd)
267-
fileStream.destroy();
268-
// we need to unlink the file ourselves
269-
fs.unlinkSync(filePath);
270-
});
271268
return undefined;
272269
});
273270
}

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "arsenal",
33
"engines": {
4-
"node": ">=8"
4+
"node": ">=16"
55
},
66
"version": "8.1.19",
77
"description": "Common utilities for the S3 project components",
@@ -30,7 +30,7 @@
3030
"bson": "4.0.0",
3131
"debug": "~4.1.0",
3232
"diskusage": "^1.1.1",
33-
"fcntl": "github:scality/node-fcntl",
33+
"fcntl": "github:scality/node-fcntl#0.2.0",
3434
"hdclient": "scality/hdclient#489db2106570b9ea41bdacdf56131324d0db6a58",
3535
"https-proxy-agent": "^2.2.0",
3636
"ioredis": "4.9.5",
@@ -50,7 +50,7 @@
5050
"xml2js": "~0.4.23"
5151
},
5252
"optionalDependencies": {
53-
"ioctl": "2.0.1"
53+
"ioctl": "^2.0.2"
5454
},
5555
"devDependencies": {
5656
"@sinonjs/fake-timers": "^6.0.1",
@@ -68,7 +68,7 @@
6868
"lint": "eslint $(git ls-files '*.js')",
6969
"lint_md": "mdlint $(git ls-files '*.md')",
7070
"lint_yml": "yamllint $(git ls-files '*.yml')",
71-
"test": "mocha --recursive --timeout 5500 --exit tests/unit",
71+
"test": "mocha --recursive --exit tests/unit",
7272
"ft_test": "find tests/functional -name \"*.js\" | grep -v \"utils/\" | xargs mocha --timeout 120000 --exit",
7373
"coverage": "yarn coverage_unit && yarn coverage_ft && yarn coverage_report",
7474
"coverage_unit": "nyc --silent yarn test",

tests/unit/network/http/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ describe('network.Server: ', () => {
208208
assert.strictEqual(ws._server._connections, 1);
209209
setTimeout(() => {
210210
// client connection should have been closed after more than 1000ms
211-
assert.strictEqual(ws._server.connections, 0);
211+
assert.strictEqual(ws._server._connections, 0);
212212
ws.stop();
213213
ws.onStop(done);
214214
}, 200);

tests/unit/network/rest/index.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,11 @@ describe('REST interface for blob data storage', () => {
115115
assert(usage.total > 0);
116116
subDone();
117117
});
118-
}],
119-
err => {
120-
done(err);
121-
});
118+
},
119+
],
120+
err => {
121+
done(err);
122+
});
122123
});
123124
});
124125

tests/unit/storage/data/DummyService.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ class DummyGetObjectRequest {
4242
on() {
4343
return this;
4444
}
45+
46+
abort() {
47+
return this;
48+
}
4549
}
4650

4751
class DummyService {

0 commit comments

Comments
 (0)