Browse Source

Merge of 1.0 branch

Brian Aker 12 years ago
parent
commit
433c022d82

+ 6 - 0
ChangeLog

@@ -1,3 +1,6 @@
+1.1.4
+*
+
 1.1.3 Wed Nov  7 22:48:21 EST 2012
 * Merge with 1.0.1
 
@@ -10,6 +13,9 @@
 1.1.0 Wed Sep  5 08:33:37 PDT 2012
 * Fix for ABI compatibility issues.
 
+1.0.2
+* Add --expceptions to Gearmand to enable exceptions by default
+
 1.0.1 Tue Nov  6 01:07:07 EST 2012
 * Stable branch labeled as 1.0
 * Update all build related files.

+ 15 - 19
benchmark/include.am

@@ -11,12 +11,10 @@
 # All paths should be given relative to the root
 
 
-noinst_PROGRAMS+= \
-		  benchmark/blobslap_client \
-		  benchmark/blobslap_worker
+noinst_PROGRAMS+= benchmark/blobslap_client
+noinst_PROGRAMS+= benchmark/blobslap_worker
 
-noinst_HEADERS+= \
-		 benchmark/benchmark.h
+noinst_HEADERS+= benchmark/benchmark.h
 
 noinst_LTLIBRARIES+= benchmark/libbenchmark.la
 benchmark_libbenchmark_la_SOURCES= benchmark/benchmark.cc
@@ -27,20 +25,18 @@ benchmark_blobslap_client_LDADD= benchmark/libbenchmark.la libgearman/libgearman
 benchmark_blobslap_worker_CXXFLAGS=
 benchmark_blobslap_worker_LDADD=
 benchmark_blobslap_worker_SOURCES=
-benchmark_blobslap_worker_SOURCES+= \
-				    benchmark/blobslap_worker.cc \
-				    util/daemon.cc \
-				    util/logfile.cc \
-				    util/pidfile.cc \
-				    util/signal.cc
-benchmark_blobslap_worker_CXXFLAGS+= $(PTHREAD_CFLAGS)
-benchmark_blobslap_worker_CXXFLAGS+= $(BOOST_CPPFLAGS)
-benchmark_blobslap_worker_LDADD+= \
-				  $(BOOST_PROGRAM_OPTIONS_LDFLAGS) \
-				  $(BOOST_PROGRAM_OPTIONS_LIBS) \
-				  benchmark/libbenchmark.la \
-				  libgearman/libgearman.la
-benchmark_blobslap_worker_LDADD+= $(PTHREAD_LIBS)
+benchmark_blobslap_worker_SOURCES+= benchmark/blobslap_worker.cc
+benchmark_blobslap_worker_SOURCES+= util/daemon.cc
+benchmark_blobslap_worker_SOURCES+= util/logfile.cc
+benchmark_blobslap_worker_SOURCES+= util/pidfile.cc
+benchmark_blobslap_worker_SOURCES+= util/signal.cc
+benchmark_blobslap_worker_CXXFLAGS+= @PTHREAD_CFLAGS@
+benchmark_blobslap_worker_CXXFLAGS+= @BOOST_CPPFLAGS@
+benchmark_blobslap_worker_LDADD+= $(BOOST_PROGRAM_OPTIONS_LDFLAGS)
+benchmark_blobslap_worker_LDADD+= $(BOOST_PROGRAM_OPTIONS_LIBS)
+benchmark_blobslap_worker_LDADD+= benchmark/libbenchmark.la
+benchmark_blobslap_worker_LDADD+= libgearman/libgearman.la
+benchmark_blobslap_worker_LDADD+= @PTHREAD_LIBS@
 
 GEARMAND_BE_PIDFILE = ${abs_top_builddir}/tests/var/tmp/Begearmand.pid
 GEARMAND_BENCHMARK_PORT = 6000

+ 12 - 11
bin/include.am

@@ -22,22 +22,23 @@ noinst_HEADERS+= \
 bin_PROGRAMS+= bin/gearman
 bin_PROGRAMS+= bin/gearadmin
 
-bin_gearadmin_SOURCES= \
-		       bin/gearadmin.cc \
-		       util/instance.cc \
-		       util/operation.cc
-bin_gearadmin_CXXFLAGS= $(BOOST_CPPFLAGS)
+bin_gearadmin_SOURCES=
+bin_gearadmin_SOURCES+= bin/gearadmin.cc
+bin_gearadmin_SOURCES+= util/instance.cc
+bin_gearadmin_SOURCES+= util/operation.cc
+
+bin_gearadmin_CXXFLAGS= @BOOST_CPPFLAGS@
 bin_gearadmin_LDFLAGS= $(BOOST_PROGRAM_OPTIONS_LDFLAGS)
 bin_gearadmin_LDADD=
 bin_gearadmin_LDADD+= $(BOOST_PROGRAM_OPTIONS_LIBS)
 bin_gearadmin_LDADD+= ${BETTER_MALLOC_LIBS}
 
-bin_gearman_SOURCES= \
-		     bin/arguments.cc \
-		     bin/function.cc \
-		     bin/gearman.cc \
-		     bin/error.cc \
-		     util/pidfile.cc
+bin_gearman_SOURCES=
+bin_gearman_SOURCES+= bin/arguments.cc
+bin_gearman_SOURCES+= bin/function.cc
+bin_gearman_SOURCES+= bin/gearman.cc
+bin_gearman_SOURCES+= bin/error.cc
+bin_gearman_SOURCES+= util/pidfile.cc
 bin_gearman_LDADD= libgearman/libgearman.la
 
 GEARMAN_CLIENT_TEST= bin/gearman

+ 2 - 0
bootstrap.sh

@@ -1039,6 +1039,8 @@ check_make_target()
   case $1 in
     'self')
       ;;
+    'rpm')
+      ;;
     'gdb')
       ;;
     'clean_op')

+ 11 - 6
configure.ac

@@ -7,7 +7,7 @@
 # the COPYING file in this directory for full text.
 
 AC_PREREQ([2.63])
-AC_INIT([gearmand],[1.1.3],[https://bugs.launchpad.net/gearmand],[gearmand],[http://gearman.info/])
+AC_INIT([gearmand],[1.1.4],[https://bugs.launchpad.net/gearmand],[gearmand],[http://gearman.info/])
 AC_CONFIG_AUX_DIR([build-aux])
 AC_CONFIG_MACRO_DIR([m4])
 
@@ -18,6 +18,7 @@ AC_USE_SYSTEM_EXTENSIONS
 AM_INIT_AUTOMAKE([1.11 color-tests -Wno-portability subdir-objects foreign tar-ustar])
 
 AC_CONFIG_HEADERS([gear_config.h:gear_config.in])dnl Keep filename to 8.3 for MS-DOS.
+AC_SUBST([AUTOHEADER_FILE],[gear_config.h])
 AC_CONFIG_SRCDIR([libgearman/gearman.cc])
 
 GEARMAN_LIBRARY_VERSION=8:0:0
@@ -32,7 +33,7 @@ GEARMAN_LIBRARY_VERSION=8:0:0
 #                |        +- increment if source code has changed
 #                |           set to zero if current is incremented
 #                +- increment if interfaces have been added, removed or changed
-AC_SUBST(GEARMAN_LIBRARY_VERSION)
+AC_SUBST([GEARMAN_LIBRARY_VERSION])
 
 LT_PREREQ([2.2])
 LT_INIT([disable-static])
@@ -42,10 +43,12 @@ PANDORA_PLATFORM
 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
 AX_ASSERT
 
-dnl First look for Boost, maybe for a specific minimum version:
-BOOST_REQUIRE([1.39])
-BOOST_PROGRAM_OPTIONS
-BOOST_THREADS
+# First look for Boost, maybe for a specific minimum version:
+AC_DEFUN([CHECK_BOOST],
+         [BOOST_REQUIRE([1.39])
+         BOOST_PROGRAM_OPTIONS
+         BOOST_THREADS])
+CHECK_BOOST
 
 AX_CXX_CINTTYPES
 CONFIG_EXTRA
@@ -230,6 +233,8 @@ AX_ENDIAN
 AX_HEX_VERSION([LIBGEARMAN],[$VERSION])
 AX_HARDEN_COMPILER_FLAGS
 
+AM_CONDITIONAL([TARGET_MINGW],[test "x${MINGW}" = "xtrue"])
+
 AC_CONFIG_FILES([Makefile
                  docs/conf.py
                  libgearman-1.0/version.h

+ 1 - 0
docs/conf.py.in

@@ -346,6 +346,7 @@ man_pages = [
   ('libgearman/gearman_task_attr_t', 'gearman_task_attr_init', u'Gearmand Documentation, http://gearman.info/', [u'Data Differential http://www.datadifferential.com/'], 3),
   ('libgearman/gearman_task_attr_t', 'gearman_task_attr_init_epoch', u'Gearmand Documentation, http://gearman.info/', [u'Data Differential http://www.datadifferential.com/'], 3),
   ('libgearman/gearman_task_attr_t', 'gearman_task_attr_init_background', u'Gearmand Documentation, http://gearman.info/', [u'Data Differential http://www.datadifferential.com/'], 3),
+  ('libgearman/gearman_worker_set_identifier', 'gearman_worker_set_identifier', u'Gearmand Documentation, http://gearman.info/', [u'Data Differential http://www.datadifferential.com/'], 3),
   ('libgearman/gearman_worker_add_server', 'gearman_worker_add_server', u'Gearmand Documentation, http://gearman.info/', [u'Data Differential http://www.datadifferential.com/'], 3),
   ('libgearman/gearman_worker_add_server', 'gearman_worker_add_servers', u'Gearmand Documentation, http://gearman.info/', [u'Data Differential http://www.datadifferential.com/'], 3),
   ('libgearman/gearman_worker_add_server', 'gearman_worker_remove_servers', u'Gearmand Documentation, http://gearman.info/', [u'Data Differential http://www.datadifferential.com/'], 3),

+ 38 - 0
docs/libgearman/gearman_worker_set_identifier.rst

@@ -0,0 +1,38 @@
+
+=============================
+Setting a worker's identifier
+=============================
+
+
+--------
+SYNOPSIS
+--------
+
+#include <libgearman/gearman.h>
+
+.. c:function:: gearman_return_t gearman_worker_set_identifier(gearman_worker_st *worker, const char *id, size_t id_size)
+
+Link with -lgearman
+
+-----------
+DESCRIPTION
+-----------
+
+:c:func:`gearman_worker_set_identifier` sets the identifier that the server uses to identify the worker.
+
+
+------------
+RETURN VALUE
+------------
+
+:c:func:`gearman_worker_set_identifier` return :c:type:`gearman_return_t`.
+
+----
+HOME
+----
+
+To find out more information please check:
+`http://gearman.info/ <http://gearman.info/>`_
+
+.. seealso:: :program:`gearmand` :doc:`../libgearman`  :c:type:`gearman_worker_st`
+

+ 1 - 0
docs/libgearman/index.rst

@@ -70,6 +70,7 @@ Worker Functions
    gearman_worker_define_function
    gearman_worker_error
    gearman_worker_set_log_fn
+   gearman_worker_set_identifier
 
 ****
 Misc

+ 7 - 1
gearmand/gearmand.cc

@@ -116,6 +116,7 @@ int main(int argc, char *argv[])
   std::string config_file;
 
   uint32_t threads;
+  bool opt_exceptions;
   bool opt_round_robin;
   bool opt_daemon;
   bool opt_check_args;
@@ -130,6 +131,9 @@ int main(int argc, char *argv[])
   ("daemon,d", boost::program_options::bool_switch(&opt_daemon)->default_value(false),
    "Daemon, detach and run in the background.")
 
+  ("exceptions", boost::program_options::bool_switch(&opt_exceptions)->default_value(false),
+   "Enable protocol exceptions by default.")
+
   ("file-descriptors,f", boost::program_options::value(&fds),
    "Number of file descriptors to allow for the process (total connections will be slightly less). Default is max allowed for user.")
 
@@ -330,7 +334,7 @@ int main(int argc, char *argv[])
                                           static_cast<uint8_t>(job_retries),
                                           static_cast<uint8_t>(worker_wakeup),
                                           _log, &log_info, verbose,
-                                          opt_round_robin);
+                                          opt_round_robin, opt_exceptions);
   if (_gearmand == NULL)
   {
     error::message("Could not create gearmand library instance.");
@@ -461,6 +465,8 @@ static void _shutdown_handler(int signal_arg)
 static void _reset_log_handler(int) // signal_arg
 {
   gearmand_log_info_st *log_info= static_cast<gearmand_log_info_st *>(Gearmand()->log_context);
+  
+  log_info->write(GEARMAND_VERBOSE_NOTICE, "SIGHUP, reopening log file");
 
   log_info->reset();
 }

+ 1 - 1
gearmand/log.hpp

@@ -47,7 +47,7 @@ struct gearmand_log_info_st
   bool opt_file;
   bool init_success;
 
-  gearmand_log_info_st(const std::string &filename_arg, bool syslog_arg) :
+  gearmand_log_info_st(const std::string &filename_arg, const bool syslog_arg) :
     filename(filename_arg),
     fd(-1),
     opt_syslog(syslog_arg),

Some files were not shown because too many files changed in this diff