binlogs continually increase when delaying jobs
Author: simon816Created May 2, 2022Updated Mar 9, 2026
LabelsNeedsFix
Beanstalk versions: 1.11, 1.12, current master (4c275d5945299e4562389f9f2ca7c326173d6335)
Steps to reproduce:
- Launch beanstalkd with binlogs enabled
- Fill a tube with 100k jobs
- Continually reserve and release the jobs with a delay
- Observe that over time, the binlog size increases
I would expect that for a fixed size of jobs, the size of the binlogs remains fixed.
Example perl code:
Create jobs
use strict;
use warnings;
use Beanstalk::Client;
my $c = Beanstalk::Client->new();
$c->use('test');
for (1 .. 100_000) {
$c->put({}, {});
}Worker:
use strict;
use warnings;
use Beanstalk::Client;
my $c = Beanstalk::Client->new();
$c->watch('test');
while (1) {
my $job = $c->reserve;
$job->release({ delay => 20 });
}Cause:
I believe it's due to filewrjobshort being called every time the job becomes ready, these Jobrec dumps are never cleaned up until the job is deleted. https://github.com/beanstalkd/beanstalkd/blob/4c275d5945299e4562389f9f2ca7c326173d6335/walg.c#L186
Source: beanstalkd/beanstalkd