Compare commits

...

9 Commits

Author SHA1 Message Date
Alejandro Celaya
52d257dd42 Merge pull request #2481 from shlinkio/develop
Release 4.5.2
2025-08-27 09:45:58 +02:00
Alejandro Celaya
613c7b7368 Merge pull request #2480 from acelaya-forks/feature/garbage-collection
Garbage collect after every request
2025-08-27 09:41:38 +02:00
Alejandro Celaya
232f6e37c6 Ensure pipeline is not marked as failed if only v8.5 fails 2025-08-27 09:30:41 +02:00
Alejandro Celaya
c818d5603d Garbage collect after every request 2025-08-27 09:24:28 +02:00
Alejandro Celaya
ff77d8b149 Merge pull request #2479 from shlinkio/develop
Release 4.5.1
2025-08-24 11:28:44 +02:00
Alejandro Celaya
95be5a93fc Merge pull request #2478 from acelaya-forks/feature/memory-leak-mitigation
Try to mitigate memory leaks when using RoadRunner
2025-08-24 11:23:57 +02:00
Alejandro Celaya
20c41690da Try to mitigate memory leaks when using RoadRunner 2025-08-24 11:18:40 +02:00
Alejandro Celaya
22b5fa5a83 Merge pull request #2474 from acelaya-forks/feature/symfony-lock
Update to symfony/lock ^7.3.2
2025-08-01 08:28:05 +02:00
Alejandro Celaya
0c4d1b6d2f Update to symfony/lock ^7.3.2 2025-08-01 08:21:37 +02:00
6 changed files with 47 additions and 4 deletions

View File

@@ -14,7 +14,7 @@ jobs:
strategy:
matrix:
php-version: ['8.3', '8.4', '8.5']
continue-on-error: ${{ inputs.php-version == '8.5' }}
continue-on-error: ${{ matrix.php-version == '8.5' }}
env:
LC_ALL: C
steps:

View File

@@ -14,7 +14,7 @@ jobs:
strategy:
matrix:
php-version: ['8.3', '8.4', '8.5']
continue-on-error: ${{ inputs.php-version == '8.5' }}
continue-on-error: ${{ matrix.php-version == '8.5' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # rr get-binary picks this env automatically
steps:

View File

@@ -4,6 +4,39 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com), and this project adheres to [Semantic Versioning](https://semver.org).
## [4.5.2] - 2025-08-27
### Added
* *Nothing*
### Changed
* *Nothing*
### Deprecated
* *Nothing*
### Removed
* *Nothing*
### Fixed
* [#2433](https://github.com/shlinkio/shlink/issues/2433) Try to mitigate memory leaks allowing RoadRunner to garbage collect memory after every request and every job, by setting `GC_COLLECT_CYCLES=true`.
## [4.5.1] - 2025-08-24
### Added
* *Nothing*
### Changed
* *Nothing*
### Deprecated
* *Nothing*
### Removed
* *Nothing*
### Fixed
* [#2433](https://github.com/shlinkio/shlink/issues/2433) Try to mitigate memory leaks by restarting job and http workers every 250 executions when using RoadRunner.
## [4.5.0] - 2025-07-24
### Added

View File

@@ -2,18 +2,22 @@
declare(strict_types=1);
namespace Shlinkio\Shlink;
use Mezzio\Application;
use Psr\Container\ContainerInterface;
use Shlinkio\Shlink\Common\Middleware\RequestIdMiddleware;
use Shlinkio\Shlink\EventDispatcher\RoadRunner\RoadRunnerTaskConsumerToListener;
use Spiral\RoadRunner\Http\PSR7Worker;
use function gc_collect_cycles;
use function Shlinkio\Shlink\Config\env;
(static function (): void {
/** @var ContainerInterface $container */
$container = include __DIR__ . '/../config/container.php';
$rrMode = env('RR_MODE');
$gcCollectCycles = env('GC_COLLECT_CYCLES', default: false);
if ($rrMode === 'http') {
// This was spin-up as a web worker
@@ -25,6 +29,10 @@ use function Shlinkio\Shlink\Config\env;
$worker->respond($app->handle($req));
} catch (Throwable $e) {
$worker->getWorker()->error((string) $e);
} finally {
if ($gcCollectCycles) {
gc_collect_cycles();
}
}
}
} else {

View File

@@ -45,7 +45,7 @@
"shlinkio/doctrine-specification": "^2.2",
"shlinkio/shlink-common": "^7.1",
"shlinkio/shlink-config": "^4.0",
"shlinkio/shlink-event-dispatcher": "^4.2",
"shlinkio/shlink-event-dispatcher": "^4.3",
"shlinkio/shlink-importer": "^5.6",
"shlinkio/shlink-installer": "^9.6",
"shlinkio/shlink-ip-geolocation": "^4.3",
@@ -56,7 +56,7 @@
"spiral/roadrunner-jobs": "^4.6",
"symfony/console": "^7.3",
"symfony/filesystem": "^7.3",
"symfony/lock": "7.1.6",
"symfony/lock": "^7.3.2",
"symfony/process": "^7.3",
"symfony/string": "^7.3"
},

View File

@@ -14,11 +14,13 @@ http:
forbid: ['.php', '.htaccess']
pool:
num_workers: ${WEB_WORKER_NUM:-0}
max_jobs: 250 # Restart worker after processing this amount of requests to mitigate memory leaks
jobs:
timeout: 300 # 5 minutes
pool:
num_workers: ${TASK_WORKER_NUM:-0}
max_jobs: 250 # Restart worker after processing this amount of jobs to mitigate memory leaks
consume: ['shlink']
pipelines:
shlink: