From 9a112b9b8408931ffa3fc4e8994bcf1597b7b57b Mon Sep 17 00:00:00 2001 From: Maha Benzekri Date: Thu, 17 Jul 2025 11:45:21 +0200 Subject: [PATCH 1/4] Disable default timeout Starting node 18 we now have a default timeout of 300000 ( 5 minutes) set , which is not suitable for our use cases. This commit disables the default timeout by setting the server.requestTimeout to 0 https://nodejs.org/api/http.html#serverrequesttimeout Issue: CLDSRV-716 --- lib/server.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/server.js b/lib/server.js index af63e86058..fe787a4183 100644 --- a/lib/server.js +++ b/lib/server.js @@ -229,6 +229,11 @@ class S3Server { }); } + // Starting NodeJS v18, the default timeout, when `undefined`, is + // 5 minutes. We must set the value to zero to allow for long + // upload durations. + server.requestTimeout = 0; // disabling request timeout + server.on('connection', socket => { socket.on('error', err => logger.info('request rejected', { error: err })); From e27581737cfe1f344f11b1d93498db0a5f72a625 Mon Sep 17 00:00:00 2001 From: Maha Benzekri Date: Thu, 17 Jul 2025 12:17:01 +0200 Subject: [PATCH 2/4] unit test addition for timeout disabing Issue: CLDSRV-716 --- lib/server.js | 1 + tests/unit/server.js | 46 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 tests/unit/server.js diff --git a/lib/server.js b/lib/server.js index fe787a4183..8caa0d0c2f 100644 --- a/lib/server.js +++ b/lib/server.js @@ -411,3 +411,4 @@ function main() { } module.exports = main; +module.exports.S3Server = S3Server; diff --git a/tests/unit/server.js b/tests/unit/server.js new file mode 100644 index 0000000000..0449016e5f --- /dev/null +++ b/tests/unit/server.js @@ -0,0 +1,46 @@ +'use strict'; + +const assert = require('assert'); +const sinon = require('sinon'); +const http = require('http'); +const https = require('https'); +const { config: defaultConfig } = require('../../lib/Config'); +const { S3Server } = require('../../lib/server'); + +describe('S3Server request timeout', () => { + let sandbox; + let mockServer; + + beforeEach(() => { + sandbox = sinon.createSandbox(); + + // Create a mock server to capture the requestTimeout setting + mockServer = { + requestTimeout: null, + on: sandbox.stub(), + listen: sandbox.stub(), + address: sandbox.stub().returns({ address: '127.0.0.1', port: 8000 }), + }; + + // Mock server creation to return our mock + sandbox.stub(http, 'createServer').returns(mockServer); + sandbox.stub(https, 'createServer').returns(mockServer); + }); + + afterEach(() => { + sandbox.restore(); + }); + + it('should set server.requestTimeout to 0 when starting server', () => { + const server = new S3Server({ + ...defaultConfig, + https: false + }); + + // Call _startServer which should set requestTimeout = 0 + server._startServer(() => {}, 8000, '127.0.0.1'); + + // Verify that requestTimeout was set to 0 + assert.strictEqual(mockServer.requestTimeout, 0); + }); +}); From b9179dad672711bc29d17c33f55846c3fd3e759b Mon Sep 17 00:00:00 2001 From: Kerkesni Date: Tue, 15 Jul 2025 17:30:25 +0200 Subject: [PATCH 3/4] ci: upgrade Ruby to 3.2 and modernize gem dependencies MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Upgrade Ruby from 2.5.9 to 3.2 in ceph-backend-test job - Update gem versions for Ruby 3.2 compatibility: - nokogiri: 1.12.5 → 1.15.5 - excon: 0.109.0 → 0.111.0 - fog-aws: 1.3.0 → 3.19.0 - mime-types: 3.1 → 3.5.2 - rspec: 3.5 → 3.12.0 - Fixes "Proc object without a block" and numbered parameter syntax errors - Resolves multi_json dependency conflicts with modern Ruby versions Issue: CLDSRV-715 --- .github/workflows/tests.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 9eb81e6a7a..6b00987bcd 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -570,10 +570,10 @@ jobs: uses: ./.github/actions/setup-ci - uses: ruby/setup-ruby@v1 with: - ruby-version: '2.5.9' + ruby-version: '3.2' - name: Install Ruby dependencies run: | - gem install nokogiri:1.12.5 excon:0.109.0 fog-aws:1.3.0 json:2.7.6 mime-types:3.1 rspec:3.5 + gem install nokogiri:1.15.5 excon:0.111.0 fog-aws:3.19.0 json:2.7.6 mime-types:3.5.2 rspec:3.12.0 - name: Install Java dependencies run: | sudo apt-get update && sudo apt-get install -y --fix-missing default-jdk maven From 217a4b7b63be65b14a7454f0f9b3e02a6364d941 Mon Sep 17 00:00:00 2001 From: Maha Benzekri Date: Thu, 17 Jul 2025 12:02:47 +0200 Subject: [PATCH 4/4] bump project version Issue: CLDSRV-716 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index cecd79c79f..fc92d69362 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@zenko/cloudserver", - "version": "9.0.7+hotfix.1", + "version": "9.0.7+hotfix.2", "description": "Zenko CloudServer, an open-source Node.js implementation of a server handling the Amazon S3 protocol", "main": "index.js", "engines": {