Merge lp:~brianaker/libmemcached/1251482 into lp:libmemcached/1.0

Proposed by Brian Aker
Status: Merged
Merged at revision: 1173
Proposed branch: lp:~brianaker/libmemcached/1251482
Merge into: lp:libmemcached/1.0
Diff against target: 394 lines (+92/-77)
15 files modified
ChangeLog (+1/-0)
bootstrap.sh (+4/-0)
configure.ac (+8/-10)
libmemcached/behavior.cc (+0/-5)
libmemcached/include.am (+9/-5)
libmemcached/server.hpp (+13/-10)
libtest/include.am (+3/-1)
m4/ax_check_library.m4 (+0/-3)
m4/ax_dlopen.m4 (+0/-10)
m4/ax_pthread.m4 (+0/-2)
m4/ax_sasl.m4 (+27/-28)
tests/include.am (+2/-2)
tests/libmemcached-1.0/all_tests.h (+1/-0)
tests/libmemcached-1.0/mem_functions.cc (+23/-1)
tests/libmemcached-1.0/mem_functions.h (+1/-0)
To merge this branch: bzr merge lp:~brianaker/libmemcached/1251482
Reviewer Review Type Date Requested Status
Brian Aker Approve
Tangent Trunk Pending
Review via email: mp+195943@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Brian Aker (brianaker) :
review: Approve
lp:~brianaker/libmemcached/1251482 updated
1173. By Tangent.Org Continuous Integration

Merge lp:~brianaker/libmemcached/1251482 Build: jenkins-Libmemcached-404

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ChangeLog'
2--- ChangeLog 2013-04-23 08:03:33 +0000
3+++ ChangeLog 2013-11-23 03:07:18 +0000
4@@ -1,4 +1,5 @@
5 1.0.18
6+* MEMCACHED_BEHAVIOR_RETRY_TIMEOUT can now be set to zero.
7
8 1.0.17 Tue Apr 2 14:02:01 HST 2013
9 * Remove c++ namespace that was being exposed (the API should be plug compatible)..
10
11=== modified file 'bootstrap.sh'
12--- bootstrap.sh 2013-10-18 07:06:29 +0000
13+++ bootstrap.sh 2013-11-23 03:07:18 +0000
14@@ -404,6 +404,10 @@
15 # Arguments for configure
16 local BUILD_CONFIGURE_ARG=''
17
18+ if $jenkins_build_environment; then
19+ BUILD_CONFIGURE_ARG="--disable-silent-rules "
20+ fi
21+
22 # If debug is set we enable both debug and asssert, otherwise we see if this is a VCS checkout and if so enable assert
23 # Set ENV ASSERT in order to enable assert.
24 # If we are doing a valgrind run, we always compile with assert disabled
25
26=== modified file 'configure.ac'
27--- configure.ac 2013-11-04 11:17:45 +0000
28+++ configure.ac 2013-11-23 03:07:18 +0000
29@@ -47,17 +47,20 @@
30 m4_include([libhashkit/include.m4])
31
32 LT_PREREQ([2.2])
33-LT_INIT
34+LT_INIT([dlopen])
35 LT_LANG([C++])
36 LT_LIB_M
37
38+AC_SUBST([lt_cv_dlopen_libs])
39+
40+
41 AC_PROG_CC_C99
42 AS_IF([test "x${ac_cv_prog_cc_c99}" == "xno"],[AC_MSG_ERROR([No c99 compatible compiler found])])
43
44 AC_DEFUN([CHECK_CXX0X],[
45 AC_LANG_PUSH([C++])
46 AX_CHECK_COMPILE_FLAG([-std=c++0x],[
47- CXXFLAGS="$CXXFLAGS -std=c++0x"])
48+ CXX="$CXX -std=c++0x"])
49 AC_LANG_POP([C++])
50 ])
51 CHECK_CXX0X
52@@ -68,10 +71,6 @@
53
54 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
55
56-AX_CXX_HEADER_STDCXX_98
57-AS_IF([test "x$ax_cv_cxx_stdcxx_98" = "xno"],
58- [AC_MSG_ERROR([Your system lacks a new enough C++ compiler])])
59-
60 AC_DEFUN([LIBMEMCACHED_PROTOCOL],
61 [AC_ARG_ENABLE([libmemcachedprotocol],
62 [AS_HELP_STRING([--enable-libmemcachedprotocol],
63@@ -254,9 +253,6 @@
64 [AC_DEFINE([HAVE_CLOCK_GETTIME],[0],[Have clock_gettime])])
65
66
67-# Check for the ability to call dlopen (used in libhostile)
68-AX_DLOPEN
69-
70 AC_CHECK_HEADERS([atomic.h])
71 AS_IF([test "x$ac_cv_header_atomic_h" = "xyes"],
72 [AC_CHECK_FUNCS([atomic_add_64])
73@@ -297,8 +293,10 @@
74 AX_UUID_GENERATE_TIME_SAFE
75
76 AC_DEFUN([CHECK_FOR_PTHREAD_AND_SASL],
77- [AX_PTHREAD(, [AC_MSG_ERROR([could not find libpthread])])
78+ [AC_LANG_PUSH([C++])
79+ AX_PTHREAD(, [AC_MSG_ERROR([could not find libpthread])])
80 AX_PTHREAD_TIMEDJOIN_NP
81+ AC_LANG_POP([C++])
82
83 # The sasl functions should only be visible if we build with sasl support
84 #
85
86=== modified file 'libmemcached/behavior.cc'
87--- libmemcached/behavior.cc 2013-03-31 23:24:29 +0000
88+++ libmemcached/behavior.cc 2013-11-23 03:07:18 +0000
89@@ -230,11 +230,6 @@
90 break;
91
92 case MEMCACHED_BEHAVIOR_RETRY_TIMEOUT:
93- if (data == 0)
94- {
95- return memcached_set_error(*ptr, MEMCACHED_INVALID_ARGUMENTS, MEMCACHED_AT,
96- memcached_literal_param("MEMCACHED_BEHAVIOR_RETRY_TIMEOUT requires a value greater then zero."));
97- }
98 ptr->retry_timeout= int32_t(data);
99 break;
100
101
102=== modified file 'libmemcached/include.am'
103--- libmemcached/include.am 2013-02-04 07:38:04 +0000
104+++ libmemcached/include.am 2013-11-23 03:07:18 +0000
105@@ -2,7 +2,7 @@
106 # included from Top Level Makefile.am
107 # All paths should be given relative to the root
108
109-libmemcached_libmemcached_la_SOURCES =
110+libmemcached_libmemcached_la_SOURCES=
111
112 include libmemcached/csl/include.am
113
114@@ -56,8 +56,11 @@
115 EXTRA_libmemcached_libmemcached_la_DEPENDENCIES=
116 libmemcached_libmemcached_la_LIBADD=
117 libmemcached_libmemcached_la_LDFLAGS=
118-libmemcached_libmemcached_la_CFLAGS= -DBUILDING_LIBMEMCACHED
119-libmemcached_libmemcached_la_CXXFLAGS= -DBUILDING_LIBMEMCACHED
120+libmemcached_libmemcached_la_CFLAGS=
121+libmemcached_libmemcached_la_CXXFLAGS=
122+
123+libmemcached_libmemcached_la_CFLAGS+= -DBUILDING_LIBMEMCACHED
124+libmemcached_libmemcached_la_CXXFLAGS+= -DBUILDING_LIBMEMCACHED
125
126 if BUILD_WIN32
127 libmemcached_libmemcached_la_CFLAGS+= -DBUILDING_HASHKIT
128@@ -122,12 +125,13 @@
129 libmemcached/options.cc: libmemcached/csl/parser.h
130
131 libmemcached_libmemcached_la_LDFLAGS+= -version-info ${MEMCACHED_LIBRARY_VERSION}
132-libmemcached_libmemcached_la_LIBADD+= @DL_LIB@
133+libmemcached_libmemcached_la_LIBADD+= @lt_cv_dlopen_libs@
134
135 if HAVE_SASL
136+libmemcached_libmemcached_la_CFLAGS+= @PTHREAD_CFLAGS@
137 libmemcached_libmemcached_la_CXXFLAGS+= @PTHREAD_CFLAGS@
138 libmemcached_libmemcached_la_LIBADD+= @PTHREAD_LIBS@
139-libmemcached_libmemcached_la_LIBADD+= @LIBSASL_LIB@
140+libmemcached_libmemcached_la_LIBADD+= @SASL_LIB@
141 endif
142
143 if HAVE_DTRACE
144
145=== modified file 'libmemcached/server.hpp'
146--- libmemcached/server.hpp 2013-03-31 23:24:29 +0000
147+++ libmemcached/server.hpp 2013-11-23 03:07:18 +0000
148@@ -76,17 +76,20 @@
149 {
150 if (server->state != MEMCACHED_SERVER_STATE_IN_TIMEOUT)
151 {
152- struct timeval next_time;
153- if (gettimeofday(&next_time, NULL) == 0)
154- {
155- server->next_retry= next_time.tv_sec +server->root->retry_timeout;
156- }
157- else
158- {
159- server->next_retry= 1; // Setting the value to 1 causes the timeout to occur immediatly
160- }
161+ if (server->root->retry_timeout != 0)
162+ {
163+ struct timeval next_time;
164+ if (gettimeofday(&next_time, NULL) == 0)
165+ {
166+ server->next_retry= next_time.tv_sec +server->root->retry_timeout;
167+ }
168+ else
169+ {
170+ server->next_retry= 1; // Setting the value to 1 causes the timeout to occur immediatly
171+ }
172
173- server->state= MEMCACHED_SERVER_STATE_IN_TIMEOUT;
174+ server->state= MEMCACHED_SERVER_STATE_IN_TIMEOUT;
175+ }
176 if (server->server_failure_counter_query_id != server->root->query_id)
177 {
178 server->server_failure_counter++;
179
180=== modified file 'libtest/include.am'
181--- libtest/include.am 2013-05-03 07:36:06 +0000
182+++ libtest/include.am 2013-11-23 03:07:18 +0000
183@@ -170,8 +170,10 @@
184 # We are either building in tree, or with
185 libtest_libtest_la_SOURCES+= libtest/memcached.cc
186
187+if HAVE_LIBDRIZZLE
188 libtest_libtest_la_LDFLAGS+= @LIBDRIZZLE_LDFLAGS@
189 libtest_libtest_la_LIBADD+= @LIBDRIZZLE_LIB@
190+endif
191
192 libtest_libtest_la_SOURCES+= libtest/gearmand.cc
193
194@@ -244,7 +246,7 @@
195 libtest_backtrace_LDADD=
196 libtest_backtrace_SOURCES+= libtest/backtrace_test.cc
197 libtest_backtrace_SOURCES+= libmemcached/backtrace.cc
198-libtest_backtrace_LDADD+= @DL_LIB@
199+libtest_backtrace_LDADD+= @lt_cv_dlopen_libs@
200 noinst_PROGRAMS+= libtest/backtrace
201 test-backtrace: libtest/backtrace
202 @libtest/backtrace
203
204=== modified file 'm4/ax_check_library.m4'
205--- m4/ax_check_library.m4 2013-01-08 01:03:28 +0000
206+++ m4/ax_check_library.m4 2013-11-23 03:07:18 +0000
207@@ -87,9 +87,6 @@
208
209 AS_IF([test "$]AS_TR_SH([ax_cv_have_]$1)[" = "yes"],
210 [AC_DEFINE([HAVE_]$1, [1], [Define to 1 if ]$1[ is found])
211- AC_SUBST($1[_CPPFLAGS])
212- AC_SUBST($1[_LDFLAGS])
213- AC_SUBST($1[_LIB],[-l]$3)
214 ifelse([$4], , :, [$4])],
215 [ifelse([$5], , :, [$5])])
216 ])
217
218=== removed file 'm4/ax_dlopen.m4'
219--- m4/ax_dlopen.m4 2013-01-08 01:03:28 +0000
220+++ m4/ax_dlopen.m4 1970-01-01 00:00:00 +0000
221@@ -1,10 +0,0 @@
222-#serial 2
223-
224-AC_DEFUN([AX_DLOPEN],
225- [AS_IF([test "x$enable_shared" = xyes],
226- [AX_CHECK_LIBRARY([DL],[dlfcn.h],[dl],
227- [AC_DEFINE([HAVE_LIBDL],[1],[Have dlopen])
228- AC_CHECK_LIB([dl],[dlopen],[AC_DEFINE([HAVE_DLOPEN],[1],[Have dlopen])])
229- AC_CHECK_LIB([dl],[dladdr],[AC_DEFINE([HAVE_DLADDR],[1],[Have dladdr])])])])
230- ])
231-
232
233=== modified file 'm4/ax_pthread.m4'
234--- m4/ax_pthread.m4 2013-11-04 11:17:45 +0000
235+++ m4/ax_pthread.m4 2013-11-23 03:07:18 +0000
236@@ -87,7 +87,6 @@
237 AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
238 AC_DEFUN([AX_PTHREAD], [
239 AC_REQUIRE([AC_CANONICAL_HOST])
240-AC_LANG_PUSH([C])
241 ax_pthread_ok=no
242
243 # We used to check for pthread.h first, but this fails if pthread.h
244@@ -328,5 +327,4 @@
245 ax_pthread_ok=no
246 $2
247 fi
248-AC_LANG_POP
249 ])dnl AX_PTHREAD
250
251=== modified file 'm4/ax_sasl.m4'
252--- m4/ax_sasl.m4 2012-12-13 02:48:43 +0000
253+++ m4/ax_sasl.m4 2013-11-23 03:07:18 +0000
254@@ -20,33 +20,32 @@
255 # and this notice are preserved. This file is offered as-is, without any
256 # warranty.
257
258-#serial 2
259+#serial 3
260
261 AC_DEFUN([AX_SASL_OPTION],
262- [AC_REQUIRE([AX_SASL_CHECK])
263- AC_ARG_ENABLE([sasl],
264- [AS_HELP_STRING([--disable-sasl], [Build with sasl support @<:@default=on@:>@])],
265- [ac_enable_sasl="$enableval"],
266- [ac_enable_sasl=yes])
267-
268- AS_IF([test "x${ac_enable_sasl}" = xyes],
269- [AC_MSG_CHECKING([checking to see if enabling sasl])
270- AS_IF([test "x${ax_sasl_check}" = xyes],
271- [ax_sasl_option=yes],
272- [AC_MSG_WARN([request to add sasl support failed, please see config.log])
273- ac_enable_sasl=no
274- ax_sasl_option=no])
275- AC_MSG_RESULT(["$ax_sasl_option"])
276- ])
277- AM_CONDITIONAL([HAVE_SASL],[test "x${ax_sasl_option}" = xyes])
278- ])
279-
280-AC_DEFUN([AX_SASL_CHECK],
281- [ax_sasl_check=no
282- AX_CHECK_LIBRARY([LIBSASL],[sasl/sasl.h],[sasl2],
283- [ax_sasl_check=yes
284- AC_SUBST([SASL_LIB],[[-lsasl2]])
285- ])
286- AC_MSG_CHECKING([checking to see if sasl works])
287- AC_MSG_RESULT(["$ax_sasl_check"])
288- ])
289+ [AC_REQUIRE([AX_SASL_CHECK])
290+ AC_ARG_ENABLE([sasl],
291+ [AS_HELP_STRING([--disable-sasl], [Build with sasl support @<:@default=on@:>@])],
292+ [ac_enable_sasl="$enableval"],
293+ [ac_enable_sasl=yes])
294+
295+ AS_IF([test "x${ac_enable_sasl}" = xyes],[
296+ AC_MSG_CHECKING([checking to see if enabling sasl])
297+ AS_IF([test "x${ax_sasl_check}" = xyes],[
298+ ax_sasl_option=yes],[
299+ AC_MSG_WARN([request to add sasl support failed, please see config.log])
300+ ac_enable_sasl=no
301+ ax_sasl_option=no])
302+ AC_MSG_RESULT(["$ax_sasl_option"])],[
303+ ax_sasl_option=no])
304+ AM_CONDITIONAL([HAVE_SASL],[test "x${ax_sasl_option}" = xyes])
305+ ])
306+
307+AC_DEFUN([AX_SASL_CHECK],[
308+ AX_CHECK_LIBRARY([LIBSASL],[sasl/sasl.h],[sasl2],[
309+ ax_sasl_check=yes
310+ AC_SUBST([SASL_LIB],[[-lsasl2]])],[
311+ ax_sasl_check=no])
312+ AC_MSG_CHECKING([checking to see if sasl works])
313+ AC_MSG_RESULT(["$ax_sasl_check"])
314+ ])
315
316=== modified file 'tests/include.am'
317--- tests/include.am 2013-04-29 15:24:05 +0000
318+++ tests/include.am 2013-11-23 03:07:18 +0000
319@@ -27,10 +27,10 @@
320 # Cycle should always run first
321 tests_cycle_CFLAGS= $(AM_CFLAGS) $(NO_CONVERSION) $(NO_STRICT_ALIASING)
322 tests_cycle_CXXFLAGS= $(AM_CXXFLAGS)
323-tests_cycle_CXXFLAGS+= ${PTHREAD_CFLAGS}
324+tests_cycle_CXXFLAGS+= @PTHREAD_CFLAGS@
325 tests_cycle_SOURCES= tests/cycle.cc
326 tests_cycle_LDADD= $(TESTS_LDADDS)
327-tests_cycle_LDADD+= ${PTHREAD_LIBS}
328+tests_cycle_LDADD+= @PTHREAD_LIBS@
329 check_PROGRAMS+= tests/cycle
330 noinst_PROGRAMS+= tests/cycle
331
332
333=== modified file 'tests/libmemcached-1.0/all_tests.h'
334--- tests/libmemcached-1.0/all_tests.h 2013-09-15 07:19:20 +0000
335+++ tests/libmemcached-1.0/all_tests.h 2013-11-23 03:07:18 +0000
336@@ -284,6 +284,7 @@
337 {"lp:1021819", true, (test_callback_fn*)regression_1021819_TEST },
338 {"lp:1048945", true, (test_callback_fn*)regression_1048945_TEST },
339 {"lp:1067242", true, (test_callback_fn*)regression_1067242_TEST },
340+ {"lp:1251482", true, (test_callback_fn*)regression_bug_1251482 },
341 {0, false, (test_callback_fn*)0}
342 };
343
344
345=== modified file 'tests/libmemcached-1.0/mem_functions.cc'
346--- tests/libmemcached-1.0/mem_functions.cc 2013-11-04 11:17:45 +0000
347+++ tests/libmemcached-1.0/mem_functions.cc 2013-11-23 03:07:18 +0000
348@@ -4559,7 +4559,7 @@
349
350 /* Put a retry timeout to effectively activate failure_limit effect */
351 test_compare(MEMCACHED_SUCCESS,
352- memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_RETRY_TIMEOUT, true));
353+ memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_RETRY_TIMEOUT, 1));
354
355 /* change behavior that triggers memcached_quit()*/
356 test_compare(MEMCACHED_SUCCESS,
357@@ -4841,6 +4841,28 @@
358 return TEST_SUCCESS;
359 }
360
361+test_return_t regression_bug_1251482(memcached_st*)
362+{
363+ test::Memc memc("--server=localhost:5");
364+
365+ memcached_behavior_set(&memc, MEMCACHED_BEHAVIOR_RETRY_TIMEOUT, 0);
366+
367+ for (size_t x= 4; x; --x)
368+ {
369+ size_t value_length;
370+ memcached_return_t rc;
371+ char *value= memcached_get(&memc,
372+ test_literal_param(__func__),
373+ &value_length, NULL, &rc);
374+
375+ test_false(value);
376+ test_compare(0LLU, value_length);
377+ test_compare(MEMCACHED_CONNECTION_FAILURE, rc);
378+ }
379+
380+ return TEST_SUCCESS;
381+}
382+
383 test_return_t regression_1009493_TEST(memcached_st*)
384 {
385 memcached_st* memc= memcached_create(NULL);
386
387=== modified file 'tests/libmemcached-1.0/mem_functions.h'
388--- tests/libmemcached-1.0/mem_functions.h 2013-09-15 07:19:20 +0000
389+++ tests/libmemcached-1.0/mem_functions.h 2013-11-23 03:07:18 +0000
390@@ -187,3 +187,4 @@
391 test_return_t regression_1048945_TEST(memcached_st*);
392 test_return_t regression_1067242_TEST(memcached_st*);
393 test_return_t comparison_operator_memcached_st_and__memcached_return_t_TEST(memcached_st*);
394+test_return_t regression_bug_1251482(memcached_st*);

Subscribers

People subscribed via source and target branches

to all changes: