beanstalkd.git
12 years agoRemove superfluous killbeanstalkd command.v1.4.4
Keith Rarick [Fri, 5 Mar 2010 23:29:55 +0000 (5 15:29 -0800)]
Remove superfluous killbeanstalkd command.

12 years agoDon't test architecture-specific file size.
Keith Rarick [Fri, 5 Mar 2010 23:27:51 +0000 (5 15:27 -0800)]
Don't test architecture-specific file size.

We don't care about the actual file size, as long as it stays below the
limit.

12 years agoAlways provide a timeout for our main fd.
Keith Rarick [Fri, 5 Mar 2010 22:46:13 +0000 (5 14:46 -0800)]
Always provide a timeout for our main fd.

If we pass NULL into event_add here, then event_dispatch sometimes
returns -1 on Snow Leopard. Our workaround is to avoid providing a NULL
timeout.

Closes gh-34.

12 years agoMore descriptive error message.
Keith Rarick [Fri, 5 Mar 2010 22:27:13 +0000 (5 14:27 -0800)]
More descriptive error message.

12 years agoMake ifconfig command line slightly more portable.
Keith Rarick [Fri, 5 Mar 2010 02:23:41 +0000 (4 18:23 -0800)]
Make ifconfig command line slightly more portable.

Should now at least work on Linux and Mac OS X.

12 years agoRemove trailing whitespace.
Keith Rarick [Fri, 5 Mar 2010 02:23:13 +0000 (4 18:23 -0800)]
Remove trailing whitespace.

12 years agoFix make check in a VPATH configuration.
Keith Rarick [Tue, 2 Mar 2010 09:29:48 +0000 (2 01:29 -0800)]
Fix make check in a VPATH configuration.

12 years agoProduce readable test output by default.
Keith Rarick [Tue, 2 Mar 2010 08:37:40 +0000 (2 00:37 -0800)]
Produce readable test output by default.

Set the environment var VERBOSE to a nonempty string to get more verbose
output.

12 years agorefactor and make more robust and verbose
Serafeim Zanikolas [Mon, 1 Mar 2010 19:05:37 +0000 (1 20:05 +0100)]
refactor and make more robust and verbose

12 years agocleanup temporary fiu fifos
Serafeim Zanikolas [Mon, 1 Mar 2010 19:05:36 +0000 (1 20:05 +0100)]
cleanup temporary fiu fifos

12 years agorun tests only if loopback interface is configured
Serafeim Zanikolas [Mon, 1 Mar 2010 19:05:35 +0000 (1 20:05 +0100)]
run tests only if loopback interface is configured

12 years agoAllow underscore in tube names.
Keith Rarick [Mon, 1 Mar 2010 06:08:29 +0000 (28 22:08 -0800)]
Allow underscore in tube names.

Closes gh-24.

12 years agoFix a memory leak in list-tubes-watched.
sebest [Mon, 1 Mar 2010 05:06:17 +0000 (28 21:06 -0800)]
Fix a memory leak in list-tubes-watched.

Closes gh-29.

12 years agoShell tests use python script instead of netcat, to avoid problems with partial respo...
Paul Annesley [Sat, 30 Jan 2010 05:50:49 +0000 (30 16:50 +1100)]
Shell tests use python script instead of netcat, to avoid problems with partial responses.

12 years agoShell tests updated to expect YAML doc separators in stats-job commands.
Paul Annesley [Sat, 30 Jan 2010 05:08:31 +0000 (30 16:08 +1100)]
Shell tests updated to expect YAML doc separators in stats-job commands.

12 years agoMoved format for stats-job to STATS_JOB_FMT, consistent with other stats commands.
Paul Annesley [Wed, 27 Jan 2010 17:22:51 +0000 (28 04:22 +1100)]
Moved format for stats-job to STATS_JOB_FMT, consistent with other stats commands.

12 years agoAdded missing YAML document separator to stats-job output.
Paul Annesley [Wed, 27 Jan 2010 17:18:21 +0000 (28 04:18 +1100)]
Added missing YAML document separator to stats-job output.

The YAML document separator (---) is present in stats and stats-tube output,
but is missing from stats-job output.

12 years agoFix some memory leaks.v1.4.3
Keith Rarick [Sun, 29 Nov 2009 01:04:39 +0000 (28 17:04 -0800)]
Fix some memory leaks.

Thanks to Ask Bjørn Hansen for reporting the leaks and to valgrind for
finding them.

12 years agoAllow writing buried jobs to the binlog.
Keith Rarick [Sat, 28 Nov 2009 11:25:06 +0000 (28 03:25 -0800)]
Allow writing buried jobs to the binlog.

Thanks to Erwan A. for the bug report.

12 years agoOkay, screw autoconf. It tries to do too much.
Keith Rarick [Sat, 28 Nov 2009 10:36:01 +0000 (28 02:36 -0800)]
Okay, screw autoconf. It tries to do too much.

12 years agoConsistently use quit command in tests.
Keith Rarick [Sat, 28 Nov 2009 10:13:09 +0000 (28 02:13 -0800)]
Consistently use quit command in tests.

12 years agoCorrectly calculate ftruncate size.
Keith Rarick [Sat, 28 Nov 2009 01:33:30 +0000 (27 17:33 -0800)]
Correctly calculate ftruncate size.

The file might be slightly bigger than binlog_size_limit, but the number
of bytes written should always be binlog_size_limit - b->free -
b->reserved. And b->reserved should be zero for a binlog ready to be
closed. (Also, the offset argument to lseek should have been negated.)

Also test for truncated binlog files.

12 years agoPlacate all the compilers. Ugly.
Keith Rarick [Fri, 27 Nov 2009 20:33:42 +0000 (27 12:33 -0800)]
Placate all the compilers. Ugly.

Thanks to Johan Bergström <bugs@bergstroem.nu> for the idea.

12 years ago10.6 build fix
Johan Bergström [Fri, 20 Nov 2009 13:51:13 +0000 (20 14:51 +0100)]
10.6 build fix

12 years agoDon't delete beanstalkd.spec during distclean.
Keith Rarick [Wed, 25 Nov 2009 04:54:09 +0000 (24 20:54 -0800)]
Don't delete beanstalkd.spec during distclean.

12 years agoQuiet compiler warning about unused return value.
Keith Rarick [Tue, 17 Nov 2009 23:32:13 +0000 (17 15:32 -0800)]
Quiet compiler warning about unused return value.

We don't really care if the ftruncate call fails, it just means
beanstalkd might report warnings next time it starts up.

12 years agoMerge commit 'abh/master'; commit 'gbarr/truncate-binlog'
Keith Rarick [Tue, 17 Nov 2009 23:20:52 +0000 (17 15:20 -0800)]
Merge commit 'abh/master'; commit 'gbarr/truncate-binlog'

12 years agoAvoid EOF warnings when reading binlogs
Graham Barr [Tue, 17 Nov 2009 15:23:09 +0000 (17 09:23 -0600)]
Avoid EOF warnings when reading binlogs

unused free space at the end of a binlog file can cause unexpected EOF warnings
when restarting beanstalkd. Avoid such warnings by truncating free space
when closing a binlog file

12 years agoFix problem with delayed events being delayed for 213 days
Graham Barr [Tue, 17 Nov 2009 02:41:27 +0000 (16 18:41 -0800)]
Fix problem with delayed events being delayed for 213 days

The problem is potential overflow of a unsigned

in net.c line 108 it has

   timeval_from_usec(&tv, deadline_at - now);

problem is that between when deadline_at is calculated and when now is fetched we can end up with deadline_at < now and because they are unsigned we end up with a huge timeout

12 years agoUpdate documentation.
Keith Rarick [Thu, 5 Nov 2009 23:47:39 +0000 (5 15:47 -0800)]
Update documentation.

12 years agounit test changes
Graham Barr [Thu, 5 Nov 2009 18:53:50 +0000 (5 10:53 -0800)]
unit test changes

make check for old nc more explicit, nc6 included the word option even though -q is valid

increase timeout so that pause-tube test can run

add explicit quit to each test so that server will close connection at end of test
and not have to wait for timeout

12 years agoAdd tests for pause-tube
Graham Barr [Thu, 5 Nov 2009 18:47:37 +0000 (5 10:47 -0800)]
Add tests for pause-tube

12 years agoAdd pause-time-left to stats-tube
Graham Barr [Thu, 5 Nov 2009 18:47:16 +0000 (5 10:47 -0800)]
Add pause-time-left to stats-tube

12 years agoAdd pause-tube command
Graham Barr [Thu, 5 Nov 2009 04:41:32 +0000 (4 20:41 -0800)]
Add pause-tube command

A new command pause-tube which results in no new jobs being reserved
from a tube until the given number of seconds has passed

12 years agoNeed 64-bit math here to avoid overflow.
Keith Rarick [Sun, 25 Oct 2009 22:00:38 +0000 (25 15:00 -0700)]
Need 64-bit math here to avoid overflow.

12 years agoShow time-left only when it is meaningful.
Keith Rarick [Sat, 24 Oct 2009 00:00:36 +0000 (23 17:00 -0700)]
Show time-left only when it is meaningful.

12 years agoPrevent a potential buffer overflow reading the tube name.v1.4.2
Phil Ross [Thu, 15 Oct 2009 15:20:28 +0000 (15 16:20 +0100)]
Prevent a potential buffer overflow reading the tube name.

12 years agoMerge commit 'gbarr/binlog-read'
Keith Rarick [Sun, 18 Oct 2009 02:00:40 +0000 (17 19:00 -0700)]
Merge commit 'gbarr/binlog-read'

12 years agoTest case for binlog read bug.
Keith Rarick [Fri, 16 Oct 2009 02:32:59 +0000 (15 19:32 -0700)]
Test case for binlog read bug.

12 years agoOnly read a job body for new jobs
Graham Barr [Thu, 15 Oct 2009 16:25:00 +0000 (15 11:25 -0500)]
Only read a job body for new jobs

The body of a job is only written to the binlog when a job is
first created. all other times only the job struct is written.

For new jobs the tube namelen will be >0, if this is an existing
job the tube_namelen will be zero, so do not attemtp to read the
job body

12 years agoUpdate the (woefully) out-of-date man page.v1.4.1
Keith Rarick [Wed, 14 Oct 2009 22:14:59 +0000 (14 15:14 -0700)]
Update the (woefully) out-of-date man page.

12 years agoFixed contradition re. quit command in protocol doc.
Paul Annesley [Mon, 12 Oct 2009 10:55:05 +0000 (12 21:55 +1100)]
Fixed contradition re. quit command in protocol doc.

The diff excluding changes to wordwrapping is:

-There is no command to close the connection -- the client may
+The client may issue the "quit" command, or

12 years agoMerge commit 'lericson/master'
Keith Rarick [Mon, 12 Oct 2009 01:20:29 +0000 (11 18:20 -0700)]
Merge commit 'lericson/master'

12 years agoMerge commit 'copiousfreetime/update-script-options'
Keith Rarick [Mon, 12 Oct 2009 01:07:57 +0000 (11 18:07 -0700)]
Merge commit 'copiousfreetime/update-script-options'

12 years agoFix build on FreeBSD.
Keith Rarick [Mon, 12 Oct 2009 00:52:13 +0000 (11 17:52 -0700)]
Fix build on FreeBSD.

Thanks to Peter Kieltyka http://github.com/pkieltyka for the fix.
Closes gh-21.

12 years agoAdd files to the distribution tarball that are referenced in the spec.
Jeremy Hinegardner [Mon, 12 Oct 2009 00:46:52 +0000 (11 18:46 -0600)]
Add files to the distribution tarball that are referenced in the spec.

The distribution tarball should now be able to be built directly
into RPMs with 'rpmbuild -ta beanstalkd-<version>.tar.gz'

12 years agoForce creation of beanstalkd homedir.
Jeremy Hinegardner [Mon, 12 Oct 2009 00:46:01 +0000 (11 18:46 -0600)]
Force creation of beanstalkd homedir.

The home directory of the beanstalkd user needs to
exist so the binlog may be stored there.

12 years agoUpdate init script and configuration for 1.4 options
Jeremy Hinegardner [Mon, 12 Oct 2009 00:45:07 +0000 (11 18:45 -0600)]
Update init script and configuration for 1.4 options

12 years agoFix detection of fdatasync on OSX
Jeremy Hinegardner [Sun, 11 Oct 2009 21:53:03 +0000 (11 15:53 -0600)]
Fix detection of fdatasync on OSX

12 years agouse inttypes.h to fix printf warnings on amd64
goosmurf [Wed, 7 Oct 2009 05:46:33 +0000 (7 16:46 +1100)]
use inttypes.h to fix printf warnings on amd64

12 years agoEven better -- distribute the generated spec file.v1.4
Keith Rarick [Fri, 2 Oct 2009 21:14:44 +0000 (2 14:14 -0700)]
Even better -- distribute the generated spec file.

12 years agoSome tools don't like hyphens in version strings.
Keith Rarick [Fri, 2 Oct 2009 21:00:10 +0000 (2 14:00 -0700)]
Some tools don't like hyphens in version strings.

Rpm for sure, but I bet others, too.

12 years agoInclude only once.
Keith Rarick [Fri, 2 Oct 2009 20:57:26 +0000 (2 13:57 -0700)]
Include only once.

12 years agoInclude config.h first.
Keith Rarick [Fri, 2 Oct 2009 20:56:51 +0000 (2 13:56 -0700)]
Include config.h first.

12 years agoFix deadly typo. Always run make distcheck!
Keith Rarick [Fri, 2 Oct 2009 21:07:56 +0000 (2 14:07 -0700)]
Fix deadly typo. Always run make distcheck!

12 years agoPull the rpm spec version string from autoconf.
Keith Rarick [Fri, 2 Oct 2009 00:37:40 +0000 (1 17:37 -0700)]
Pull the rpm spec version string from autoconf.

12 years agoFallback for Solaris.
Keith Rarick [Thu, 1 Oct 2009 08:20:10 +0000 (1 01:20 -0700)]
Fallback for Solaris.

Solaris has posix_fallocate, but always returns EINVAL. So we have to
fall back to our own implementation.

12 years agoOops, struct timeval is defined in sys/time.h.
Keith Rarick [Thu, 1 Oct 2009 08:08:03 +0000 (1 01:08 -0700)]
Oops, struct timeval is defined in sys/time.h.

12 years agoOur posix_fallocate substitute rounds up files.
Keith Rarick [Thu, 1 Oct 2009 07:52:38 +0000 (1 00:52 -0700)]
Our posix_fallocate substitute rounds up files.

12 years agoPortability fixes.
Keith Rarick [Thu, 1 Oct 2009 07:49:05 +0000 (1 00:49 -0700)]
Portability fixes.

12 years agoMac OS doesn't have fdatasync.
Keith Rarick [Thu, 1 Oct 2009 06:48:01 +0000 (30 23:48 -0700)]
Mac OS doesn't have fdatasync.

12 years agoFixes for make distcheck.
Keith Rarick [Thu, 1 Oct 2009 05:52:34 +0000 (30 22:52 -0700)]
Fixes for make distcheck.

12 years agoAlways use hi-res timers internally.
Keith Rarick [Thu, 1 Oct 2009 04:48:30 +0000 (30 21:48 -0700)]
Always use hi-res timers internally.

This helps us to avoid off-by-one and roundoff errors that crop up with
one-second-granularity timers. Also makes it easier in the future to
allow clients to specify hi-res time intervals.

Closes gh-5.

12 years agoNo longer used.
Keith Rarick [Thu, 1 Oct 2009 04:39:02 +0000 (30 21:39 -0700)]
No longer used.

12 years agoBetter error messages in tests.
Keith Rarick [Thu, 1 Oct 2009 02:50:43 +0000 (30 19:50 -0700)]
Better error messages in tests.

12 years agoRefactor. Use fixed-size types where size matters.
Keith Rarick [Thu, 1 Oct 2009 02:29:19 +0000 (30 19:29 -0700)]
Refactor. Use fixed-size types where size matters.

And, just to be paranoid, we increment binlog_version.

12 years agoHandle SIGTERM.
Keith Rarick [Thu, 1 Oct 2009 02:03:58 +0000 (30 19:03 -0700)]
Handle SIGTERM.

Thanks to Florian Noeding (http://github.com/fnoeding) for the patch.

Closes gh-17.

12 years agoAdd fsync options.
Keith Rarick [Thu, 1 Oct 2009 01:59:13 +0000 (30 18:59 -0700)]
Add fsync options.

Closes gh-16.

12 years agoAdd microsecond-granularity time functions.
Keith Rarick [Thu, 1 Oct 2009 01:45:59 +0000 (30 18:45 -0700)]
Add microsecond-granularity time functions.

12 years agoCheck for stdint.h.
Keith Rarick [Thu, 1 Oct 2009 01:43:16 +0000 (30 18:43 -0700)]
Check for stdint.h.

12 years agoUse less disk space (and update tests).
Keith Rarick [Thu, 1 Oct 2009 01:06:44 +0000 (30 18:06 -0700)]
Use less disk space (and update tests).

12 years agoTest deleting jobs when the disk is full.
Keith Rarick [Thu, 1 Oct 2009 00:44:22 +0000 (30 17:44 -0700)]
Test deleting jobs when the disk is full.

12 years agoAdd a disk full test; fix the bug it exposed.
Keith Rarick [Thu, 1 Oct 2009 00:24:40 +0000 (30 17:24 -0700)]
Add a disk full test; fix the bug it exposed.

12 years agoTest binlog file size; fix the bugs it exposed.
Keith Rarick [Wed, 30 Sep 2009 23:43:08 +0000 (30 16:43 -0700)]
Test binlog file size; fix the bugs it exposed.

12 years agoUpdate comment.
Keith Rarick [Wed, 30 Sep 2009 22:54:58 +0000 (30 15:54 -0700)]
Update comment.

12 years agoConsume reserved bytes when writing to disk.
Keith Rarick [Wed, 30 Sep 2009 22:51:16 +0000 (30 15:51 -0700)]
Consume reserved bytes when writing to disk.

12 years agoUnreserve space if needed when the disk is full.
Keith Rarick [Wed, 30 Sep 2009 21:46:24 +0000 (30 14:46 -0700)]
Unreserve space if needed when the disk is full.

12 years agoMerge commit 'gbarr/binlog-tube-namelen'
Keith Rarick [Wed, 30 Sep 2009 21:31:24 +0000 (30 14:31 -0700)]
Merge commit 'gbarr/binlog-tube-namelen'

12 years agoReserve space for certain events ahead of time.
Keith Rarick [Tue, 29 Sep 2009 02:13:40 +0000 (28 19:13 -0700)]
Reserve space for certain events ahead of time.

Delete records are appended to the binlog just like everything else.
That means if there's no disk space available, the user won't be able to
delete jobs in an attempt to free up disk space. So we allocate and
reserve space ahead of time for deleting a job.

Also quite a bit of refactoring in this commit.

13 years agoFix a (very old) cut-and-paste-o.
Keith Rarick [Mon, 1 Jun 2009 16:37:16 +0000 (1 18:37 +0200)]
Fix a (very old) cut-and-paste-o.

13 years agoUpdate docs.
Keith Rarick [Mon, 18 May 2009 02:06:50 +0000 (17 19:06 -0700)]
Update docs.

13 years agoadd JOB_STATE_COPY to fix peek/stats command memory leaks
goosmurf [Thu, 2 Jul 2009 06:39:01 +0000 (2 16:39 +1000)]
add JOB_STATE_COPY to fix peek/stats command memory leaks

Closes gh-12.

13 years agoadd 'reserves' counter per job
goosmurf [Thu, 18 Jun 2009 09:06:15 +0000 (18 19:06 +1000)]
add 'reserves' counter per job

Closes gh-10.

13 years agoAdd quit to protocol docs.
lericson [Wed, 27 May 2009 12:49:14 +0000 (27 14:49 +0200)]
Add quit to protocol docs.

13 years agoImplement quit command.
lericson [Wed, 27 May 2009 11:49:11 +0000 (27 13:49 +0200)]
Implement quit command.

13 years agoOnly create a new job from binlog when we have a tube name
Graham Barr [Thu, 21 May 2009 15:49:31 +0000 (21 10:49 -0500)]
Only create a new job from binlog when we have a tube name

A READY or DELAYED entry in the binlog only has a tubename when the
job is first created. A release of a job with a delay will insert a new
entry without a tubename.

This fixes a problem when on replay of the binlog a record is
encountered that is modifying an existing job. But that job was originally
created in a prior binlog file that has been deleted becasue all
its jobs have been deleted. ie a modification to a job that has
already completed so we do not need to create it

13 years agoDitch that symbol table hack. It's not portable.
Keith Rarick [Fri, 15 May 2009 23:37:27 +0000 (15 16:37 -0700)]
Ditch that symbol table hack. It's not portable.

In particular, Mac OS and probably BSD don't like it.

Closes gh-8.

13 years agoMake shell tests run on Solaris too.
Keith Rarick [Fri, 15 May 2009 23:33:36 +0000 (15 16:33 -0700)]
Make shell tests run on Solaris too.

13 years agoFix cutgen segfault on Solaris.
Keith Rarick [Fri, 15 May 2009 23:13:30 +0000 (15 16:13 -0700)]
Fix cutgen segfault on Solaris.

Closes gh-7.

13 years agoFix compiler warnings from gcc 3.4.3 on Solaris.
Keith Rarick [Fri, 15 May 2009 23:00:43 +0000 (15 16:00 -0700)]
Fix compiler warnings from gcc 3.4.3 on Solaris.

13 years agoEnable more compiler warnings and -Werror.
Keith Rarick [Fri, 15 May 2009 22:22:03 +0000 (15 15:22 -0700)]
Enable more compiler warnings and -Werror.

Closes gh-6.

13 years agoUse autoreconf instead of make to run autotools.
Keith Rarick [Fri, 15 May 2009 22:21:01 +0000 (15 15:21 -0700)]
Use autoreconf instead of make to run autotools.

13 years agoFix compiler warning. Check return value of chdir.
Keith Rarick [Fri, 15 May 2009 22:16:45 +0000 (15 15:16 -0700)]
Fix compiler warning. Check return value of chdir.

13 years agoPortably allocate space if there's no built in way.
Keith Rarick [Wed, 13 May 2009 08:36:36 +0000 (13 01:36 -0700)]
Portably allocate space if there's no built in way.

This is mostly for FreeBSD, where I know of no way to do this efficiently. Mac
OS has an F_PREALLOCATE flag to fcntl, but we're not using that yet, so Mac
gets the slow path for now.

13 years agoStep one for preallocation on several platforms.
Keith Rarick [Wed, 13 May 2009 08:13:08 +0000 (13 01:13 -0700)]
Step one for preallocation on several platforms.

13 years agoAdd a basic binlog test.
Keith Rarick [Wed, 13 May 2009 07:46:00 +0000 (13 00:46 -0700)]
Add a basic binlog test.

13 years agoAllocate disk space more carefully. Closes gh-1.
Keith Rarick [Sat, 17 Jan 2009 18:56:10 +0000 (17 10:56 -0800)]
Allocate disk space more carefully. Closes gh-1.

13 years agoFix compiler warnings.
Keith Rarick [Tue, 5 May 2009 23:47:26 +0000 (5 16:47 -0700)]
Fix compiler warnings.

13 years agoRename this.
Keith Rarick [Tue, 5 May 2009 23:43:51 +0000 (5 16:43 -0700)]
Rename this.

13 years agoQuiet compiler warning.
Keith Rarick [Tue, 5 May 2009 21:48:54 +0000 (5 14:48 -0700)]
Quiet compiler warning.