Just tested. It compiles and detaches fine on my Intel-based Mac/OS X
10.5.6. Tested it with several client libraries and everything seems
to be fine.
One minor problem though, one of the unit tests failed with an error,
full output listed below:
<pre><code>$ make test
make: *** No rule to make target `test'. Stop.
godf...@coeus:~/Projects/beanstalkd$ make check
gcc -g -O2 -I/usr/local/include -L/usr/local/lib -Wl,-rpath,/usr/
local/lib cutgen.c -o cutgen
mkdir -p tests
./cutgen -o tests/cutcheck.c ./tests/test_job.c ./tests/test_pq.c
- parsing './tests/test_job.c'... done.
- parsing './tests/test_pq.c'... done.
gcc -DHAVE_CONFIG_H -I. -g -O2 -I/usr/local/include -c -o tests/
cutcheck.o tests/cutcheck.c
gcc -DHAVE_CONFIG_H -I. -g -O2 -I/usr/local/include -c -o cut.o
cut.c
gcc -DHAVE_CONFIG_H -I. -g -O2 -I/usr/local/include -c -o tests/
test_job.o tests/test_job.c
tests/test_job.c: In function ‘__CUT__job_test_all_jobs_used’:
tests/test_job.c:100: warning: initialization makes pointer from
integer without a cast
gcc -DHAVE_CONFIG_H -I. -g -O2 -I/usr/local/include -c -o tests/
test_pq.o tests/test_pq.c
gcc -g -O2 -I/usr/local/include -L/usr/local/lib -Wl,-rpath,/usr/
local/lib -o tests/cutcheck tests/cutcheck.o cut.o binlog.o conn.o
job.o ms.o net.o pq.o primes.o prot.o tube.o util.o tests/test_job.o
tests/test_pq.o -levent -levent -levent
tests/cutcheck
0......E... 10...
Error in group-job/job_test_all_jobs_used (Exit Status 1)
tests/test_job.c:100: no symbol: all_jobs_used
13 tests; 0 failures; 1 errors.
make: *** [check-cut] Error 1
</code></pre>
However, I can't recall whether this if this is introduced by this
particular commit or not. If I have time I'll post the unit test
results for the current stable release tomorrow.
Godfrey
On Apr 23, 3:48 am, Godfrey <[email protected]> wrote:
> Thanks kr! I'll give it a try right now.
>
> Godfrey
>
> On Apr 22, 11:32 pm, Keith Rarick <[email protected]> wrote:
>
>
>
> > Okay, I pushed a fix for this, using event_reinit. Now beanstalkd will
> > not build with libevent prior to 1.4.1.
>
> > I apologize for not replying to any of the original messages in this
> > thread over a month ago. I think my spam filter (gmail) trapped them.
>
> > kr
>
> > On Tue, Apr 21, 2009 at 2:16 AM, Keith Rarick <[email protected]> wrote:
> > > Thanks, I'll get on this tomorrow morning. All else being equal, I
> > > want to do as much as possible before forking so that errors can be
> > > detected and reported visibly.
>
> > > That leads me to option 2, calling event_reinit. If I can just go
> > > ahead and call it safely regardless of the platform I'd prefer that.
>
> > > Otherwise, I'll try moving the fork before event_init, then moving as
> > > much as possible (probably just prot_replay_binlog) before the fork.
>
> > > kr
>
> > > On Mon, Apr 20, 2009 at 5:47 PM, Godfrey <[email protected]> wrote:
>
> > >> I can confirm this problem is happening on my MBP running 10.5.6, and
> > >> yun's solution does seems to fix it.
>
> > >> Godfrey
>
> > >> On Mar 8, 7:57 pm, Yun Huang Yong <[email protected]> wrote:
> > >>> On Mar 7, 10:02 pm, Alex MacCaw <[email protected]> wrote:
>
> > >>> > I'm doing something like this:
> > >>> > beanstalkd -l 0.0.0.0 -p 8002 -d
> > >>> > And the process just disappears!
> > >>> > If I don't'detachit it, it works.
>
> > >>> > Any ideas why?
>
> > >>> This is due to BSD's kqueue event queue not surviving across fork().
> > >>> Quoting the man page (from my FreeBSD box, its the same on MacOSX):
>
> > >>> The kqueue() system call creates a new kernel event queue and
> > >>> returns a
> > >>> descriptor. The queue is not inherited by a child created with
> > >>> fork(2).
> > >>> However, if rfork(2) is called without the RFFDG flag, then the
> > >>> descrip-
> > >>> tor table is shared, which will allow sharing of the kqueue
> > >>> between two
> > >>> processes.
>
> > >>> There's a few solutions I can see to this:
>
> > >>> 1. daemonize() earlier, in my own testing I moved the "if (detach)
> > >>> daemonize();" to just before event_init(), allowing all the beanstalkd
> > >>> init stuff to execute as normal.
>
> > >>> 2. Preserve the event_base struct returned from event_init(), then
> > >>> call event_reinit() as suggested by Niels Provos
> > >>> inhttp://monkeymail.org/archives/libevent-users/2007-November/001061.html
>
> > >>> 3. Use rfork() as suggested by the kqueue man page
>
> > >>> The solutions get more and more BSD specific as you go down the list
> > >>> so Option 1. seems like the simplest solution since it keeps
> > >>> beanstalkd's execution path fairly identical across platforms (one of
> > >>> the confusing things about debugging this issue was why the "-d" fork
> > >>> () would affect behaviour so drastically). I don't think this has any
> > >>> side effects on beanstalkd...
>
> > >>> yun
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"beanstalk-talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/beanstalk-talk?hl=en
-~----------~----~----~----~------~----~------~--~---