Merge lp:~schuster/mysql-proxy/negative-clock into lp:mysql-proxy
- negative-clock
- Merge into trunk
Proposed by
Michael Schuster
Status: | Merged |
---|---|
Merge reported by: | Jan Kneschke |
Merged at revision: | not available |
Proposed branch: | lp:~schuster/mysql-proxy/negative-clock |
Merge into: | lp:mysql-proxy |
Diff against target: |
515 lines (+221/-24) (has conflicts) 10 files modified
plugins/proxy/proxy-plugin.c (+6/-5) src/CMakeLists.txt (+50/-5) src/Makefile.am (+33/-5) src/chassis-gtimeval.c (+43/-0) src/chassis-gtimeval.h (+34/-0) src/chassis-timings.c (+2/-1) src/glib-ext.c (+15/-1) src/glib-ext.h (+2/-1) src/network-backend.c (+14/-5) tests/unit/Makefile.am (+22/-1) Text conflict in src/CMakeLists.txt |
To merge this branch: | bzr merge lp:~schuster/mysql-proxy/negative-clock |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jan Kneschke (community) | Approve | ||
Review via email: mp+20125@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
- 974. By Michael Schuster
-
fix copyright (year)
Revision history for this message
Jan Kneschke (jan-kneschke) : | # |
review:
Approve
Revision history for this message
Jan Kneschke (jan-kneschke) wrote : | # |
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'plugins/proxy/proxy-plugin.c' |
2 | --- plugins/proxy/proxy-plugin.c 2010-02-08 11:23:10 +0000 |
3 | +++ plugins/proxy/proxy-plugin.c 2010-02-26 08:20:31 +0000 |
4 | @@ -1,5 +1,5 @@ |
5 | /* $%BEGINLICENSE%$ |
6 | - Copyright (C) 2007-2008 MySQL AB, 2008 Sun Microsystems, Inc |
7 | + Copyright (C) 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc |
8 | |
9 | This program is free software; you can redistribute it and/or modify |
10 | it under the terms of the GNU General Public License as published by |
11 | @@ -145,6 +145,7 @@ |
12 | #include "lua-load-factory.h" |
13 | |
14 | #include "chassis-timings.h" |
15 | +#include "chassis-gtimeval.h" |
16 | |
17 | #define C(x) x, sizeof(x) - 1 |
18 | #define S(x) x->str, x->len |
19 | @@ -1469,7 +1470,7 @@ |
20 | |
21 | /* mark the backend as being DOWN and retry with a different one */ |
22 | st->backend->state = BACKEND_STATE_DOWN; |
23 | - g_get_current_time(&(st->backend->state_since)); |
24 | + (void) chassis_gtime_testset_now(&st->backend->state_since); |
25 | network_socket_free(con->server); |
26 | con->server = NULL; |
27 | |
28 | @@ -1481,7 +1482,7 @@ |
29 | |
30 | if (st->backend->state != BACKEND_STATE_UP) { |
31 | st->backend->state = BACKEND_STATE_UP; |
32 | - g_get_current_time(&(st->backend->state_since)); |
33 | + (void) chassis_gtime_testset_now(&st->backend->state_since); |
34 | } |
35 | |
36 | con->state = CON_STATE_READ_HANDSHAKE; |
37 | @@ -1599,7 +1600,7 @@ |
38 | __FILE__, __LINE__, con->server->dst->name->str); |
39 | |
40 | st->backend->state = BACKEND_STATE_DOWN; |
41 | - g_get_current_time(&(st->backend->state_since)); |
42 | + (void) chassis_gtime_testset_now(&st->backend->state_since); |
43 | |
44 | network_socket_free(con->server); |
45 | con->server = NULL; |
46 | @@ -1609,7 +1610,7 @@ |
47 | |
48 | if (st->backend->state != BACKEND_STATE_UP) { |
49 | st->backend->state = BACKEND_STATE_UP; |
50 | - g_get_current_time(&(st->backend->state_since)); |
51 | + (void) chassis_gtime_testset_now(&st->backend->state_since); |
52 | } |
53 | |
54 | con->state = CON_STATE_READ_HANDSHAKE; |
55 | |
56 | === modified file 'src/CMakeLists.txt' |
57 | --- src/CMakeLists.txt 2010-02-25 12:39:54 +0000 |
58 | +++ src/CMakeLists.txt 2010-02-26 08:20:32 +0000 |
59 | @@ -1,3 +1,20 @@ |
60 | +# $%BEGINLICENSE%$ |
61 | +# Copyright (C) 2009-2010 Sun Microsystems, Inc |
62 | +# |
63 | +# This program is free software; you can redistribute it and/or modify |
64 | +# it under the terms of the GNU General Public License as published by |
65 | +# the Free Software Foundation; version 2 of the License. |
66 | +# |
67 | +# This program is distributed in the hope that it will be useful, |
68 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
69 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
70 | +# GNU General Public License for more details. |
71 | +# |
72 | +# You should have received a copy of the GNU General Public License |
73 | +# along with this program; if not, write to the Free Software |
74 | +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
75 | +# |
76 | +# $%ENDLICENSE%$ |
77 | INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR}) # for config.h |
78 | INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) |
79 | |
80 | @@ -17,12 +34,10 @@ |
81 | ADD_DEFINITIONS(-DSHARED_LIBRARY_SUFFIX="${SHARED_LIBRARY_SUFFIX}") |
82 | |
83 | SET(chassis_sources |
84 | - glib-ext.c |
85 | - glib-ext-ref.c |
86 | lua-load-factory.c |
87 | lua-scope.c |
88 | chassis-plugin.c |
89 | - chassis-event-thread.c |
90 | + chassis-event-thread.c |
91 | chassis-log.c |
92 | chassis-mainloop.c |
93 | chassis-shutdown-hooks.c |
94 | @@ -31,13 +46,25 @@ |
95 | chassis-filemode.c |
96 | chassis-limits.c |
97 | chassis-stats.c |
98 | +<<<<<<< TREE |
99 | ) |
100 | |
101 | SET(chassis_timing_sources |
102 | +======= |
103 | +) |
104 | + |
105 | +SET(timing_sources |
106 | +>>>>>>> MERGE-SOURCE |
107 | chassis-timings.c |
108 | + chassis-gtimeval.c |
109 | my_rdtsc.c |
110 | ) |
111 | |
112 | +SET(glibext_sources |
113 | + glib-ext.c |
114 | + glib-ext-ref.c |
115 | +) |
116 | + |
117 | SET(proxy_sources |
118 | network-mysqld.c |
119 | network-mysqld-lua.c |
120 | @@ -62,6 +89,8 @@ |
121 | ADD_LIBRARY(mysql-chassis SHARED ${chassis_sources}) |
122 | ADD_LIBRARY(mysql-chassis-timing SHARED ${chassis_timing_sources}) |
123 | ADD_LIBRARY(mysql-chassis-proxy SHARED ${proxy_sources}) |
124 | +ADD_LIBRARY(mysql-chassis-glibext SHARED ${glibext_sources}) |
125 | +ADD_LIBRARY(mysql-chassis-timing SHARED ${timing_sources}) |
126 | ADD_EXECUTABLE(mysql-proxy chassis.c) |
127 | |
128 | ## for windows we need the winsock lib |
129 | @@ -84,11 +113,17 @@ |
130 | ${LUA_LIBRARIES} |
131 | ${EVENT_LIBRARIES} |
132 | ${WINSOCK_LIBRARIES} |
133 | +<<<<<<< TREE |
134 | mysql-chassis-timing |
135 | +======= |
136 | + mysql-chassis-glibext |
137 | +>>>>>>> MERGE-SOURCE |
138 | ) |
139 | |
140 | TARGET_LINK_LIBRARIES(mysql-chassis-proxy |
141 | - mysql-chassis |
142 | + mysql-chassis |
143 | + mysql-chassis-glibext |
144 | + mysql-chassis-timing |
145 | ) |
146 | |
147 | TARGET_LINK_LIBRARIES(mysql-proxy |
148 | @@ -99,6 +134,8 @@ |
149 | ${EVENT_LIBRARIES} |
150 | mysql-chassis |
151 | mysql-chassis-proxy |
152 | + mysql-chassis-glibext |
153 | + mysql-chassis-timing |
154 | ) |
155 | |
156 | IF(WIN32) |
157 | @@ -111,6 +148,8 @@ |
158 | ${EVENT_LIBRARIES} |
159 | mysql-chassis |
160 | mysql-chassis-proxy |
161 | + mysql-chassis-glibext |
162 | + mysql-chassis-timing |
163 | ) |
164 | SET_TARGET_PROPERTIES(mysql-proxy-svc |
165 | PROPERTIES |
166 | @@ -158,7 +197,12 @@ |
167 | |
168 | CHASSIS_INSTALL_TARGET(mysql-chassis) |
169 | CHASSIS_INSTALL_TARGET(mysql-chassis-proxy) |
170 | -CHASSIS_INSTALL_TARGET(mysql-chassis-timing) |
171 | +<<<<<<< TREE |
172 | +CHASSIS_INSTALL_TARGET(mysql-chassis-timing) |
173 | +======= |
174 | +CHASSIS_INSTALL_TARGET(mysql-chassis-glibext) |
175 | +CHASSIS_INSTALL_TARGET(mysql-chassis-timing) |
176 | +>>>>>>> MERGE-SOURCE |
177 | |
178 | INSTALL(FILES |
179 | network-mysqld.h |
180 | @@ -200,6 +244,7 @@ |
181 | lua-registry-keys.h |
182 | chassis-stats.h |
183 | chassis-timings.h |
184 | + chassis-gtimeval.h |
185 | my_rdtsc.h |
186 | DESTINATION include/ |
187 | ) |
188 | |
189 | === modified file 'src/Makefile.am' |
190 | --- src/Makefile.am 2010-02-19 15:23:10 +0000 |
191 | +++ src/Makefile.am 2010-02-26 08:20:32 +0000 |
192 | @@ -1,3 +1,20 @@ |
193 | +# $%BEGINLICENSE%$ |
194 | +# Copyright (C) 2009-2010 Sun Microsystems, Inc |
195 | +# |
196 | +# This program is free software; you can redistribute it and/or modify |
197 | +# it under the terms of the GNU General Public License as published by |
198 | +# the Free Software Foundation; version 2 of the License. |
199 | +# |
200 | +# This program is distributed in the hope that it will be useful, |
201 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
202 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
203 | +# GNU General Public License for more details. |
204 | +# |
205 | +# You should have received a copy of the GNU General Public License |
206 | +# along with this program; if not, write to the Free Software |
207 | +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
208 | +# |
209 | +# $%ENDLICENSE%$ |
210 | luaextdir = ${pkglibdir}/lua |
211 | plugindir = ${pkglibdir}/plugins |
212 | |
213 | @@ -32,13 +49,26 @@ |
214 | |
215 | lib_LTLIBRARIES = |
216 | |
217 | +# functionality extending what's currently in glib |
218 | +lib_LTLIBRARIES += libmysql-chassis-glibext.la |
219 | +libmysql_chassis_glibext_la_SOURCES = \ |
220 | + glib-ext.c \ |
221 | + glib-ext-ref.c |
222 | + |
223 | +libmysql_chassis_glibext_la_LDFLAGS = -export-dynamic -no-undefined -dynamic |
224 | +libmysql_chassis_glibext_la_CPPFLAGS = $(MYSQL_CFLAGS) $(GLIB_CFLAGS) $(GMODULE_CFLAGS) |
225 | +libmysql_chassis_glibext_la_LIBADD = $(GLIB_LIBS) |
226 | + |
227 | +# library implementing timing functionality |
228 | lib_LTLIBRARIES += libmysql-chassis-timing.la |
229 | libmysql_chassis_timing_la_SOURCES = \ |
230 | chassis-timings.c \ |
231 | + chassis-gtimeval.c \ |
232 | my_rdtsc.c |
233 | + |
234 | libmysql_chassis_timing_la_LDFLAGS = -export-dynamic -no-undefined -dynamic |
235 | libmysql_chassis_timing_la_CPPFLAGS = $(MYSQL_CFLAGS) $(GLIB_CFLAGS) $(LUA_CFLAGS) $(GMODULE_CFLAGS) |
236 | -libmysql_chassis_timing_la_LIBADD = $(GLIB_LIBS) |
237 | +libmysql_chassis_timing_la_LIBADD = $(GLIB_LIBS) libmysql-chassis-glibext.la |
238 | if USE_SUNCC_ASSEMBLY |
239 | libmysql_chassis_timing_la_CPPFLAGS += \ |
240 | $(top_srcdir)/src/my_timer_cycles.il |
241 | @@ -48,8 +78,6 @@ |
242 | ## the core library |
243 | lib_LTLIBRARIES += libmysql-chassis.la |
244 | libmysql_chassis_la_SOURCES = \ |
245 | - glib-ext.c \ |
246 | - glib-ext-ref.c \ |
247 | lua-load-factory.c \ |
248 | lua-scope.c \ |
249 | chassis-plugin.c \ |
250 | @@ -66,7 +94,7 @@ |
251 | |
252 | libmysql_chassis_la_LDFLAGS = -export-dynamic -no-undefined -dynamic |
253 | libmysql_chassis_la_CPPFLAGS = $(MYSQL_CFLAGS) $(EVENT_CFLAGS) $(GLIB_CFLAGS) $(LUA_CFLAGS) $(GMODULE_CFLAGS) $(GTHREAD_CFLAGS) |
254 | -libmysql_chassis_la_LIBADD = $(EVENT_LIBS) $(GLIB_LIBS) $(LUA_LIBS) $(GMODULE_LIBS) $(GTHREAD_LIBS) libmysql-chassis-timing.la |
255 | +libmysql_chassis_la_LIBADD = $(EVENT_LIBS) $(GLIB_LIBS) $(LUA_LIBS) $(GMODULE_LIBS) $(GTHREAD_LIBS) libmysql-chassis-timing.la libmysql-chassis-glibext.la |
256 | |
257 | lib_LTLIBRARIES += libmysql-proxy.la |
258 | libmysql_proxy_la_SOURCES = \ |
259 | @@ -91,7 +119,7 @@ |
260 | |
261 | libmysql_proxy_la_LDFLAGS = -export-dynamic -no-undefined -dynamic |
262 | libmysql_proxy_la_CPPFLAGS = $(MYSQL_CFLAGS) $(GLIB_CFLAGS) $(LUA_CFLAGS) $(GMODULE_CFLAGS) |
263 | -libmysql_proxy_la_LIBADD = $(EVENT_LIBS) $(GLIB_LIBS) $(GMODULE_LIBS) libmysql-chassis.la libmysql-chassis-timing.la |
264 | +libmysql_proxy_la_LIBADD = $(EVENT_LIBS) $(GLIB_LIBS) $(GMODULE_LIBS) libmysql-chassis.la libmysql-chassis-timing.la libmysql-chassis-glibext.la |
265 | |
266 | |
267 | include_HEADERS=\ |
268 | |
269 | === added file 'src/chassis-gtimeval.c' |
270 | --- src/chassis-gtimeval.c 1970-01-01 00:00:00 +0000 |
271 | +++ src/chassis-gtimeval.c 2010-02-26 08:20:32 +0000 |
272 | @@ -0,0 +1,43 @@ |
273 | +/* $%BEGINLICENSE%$ |
274 | + Copyright (C) 2010 Sun Microsystems, Inc |
275 | + |
276 | + This program is free software; you can redistribute it and/or modify |
277 | + it under the terms of the GNU General Public License as published by |
278 | + the Free Software Foundation; version 2 of the License. |
279 | + |
280 | + This program is distributed in the hope that it will be useful, |
281 | + but WITHOUT ANY WARRANTY; without even the implied warranty of |
282 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
283 | + GNU General Public License for more details. |
284 | + |
285 | + You should have received a copy of the GNU General Public License |
286 | + along with this program; if not, write to the Free Software |
287 | + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
288 | + |
289 | + $%ENDLICENSE%$ */ |
290 | + |
291 | +#include <glib.h> |
292 | + |
293 | +#include "chassis-gtimeval.h" |
294 | + |
295 | +gint64 chassis_gtime_testset_now(GTimeVal *gt) |
296 | +{ |
297 | + GTimeVal now; |
298 | + gint64 tdiff; |
299 | + |
300 | + if (gt == NULL) |
301 | + return (0); |
302 | + |
303 | + g_get_current_time(&now); |
304 | + tdiff = ge_gtimeval_diff(gt, &now); |
305 | + |
306 | + if (tdiff < 0) { |
307 | + g_critical("%s: time went backwards (%"G_GINT64_FORMAT" usec)!", |
308 | + G_STRLOC, tdiff); |
309 | + gt->tv_usec = gt->tv_sec = 0; |
310 | + return tdiff; |
311 | + } |
312 | + |
313 | + *gt = now; |
314 | + return tdiff; |
315 | +} |
316 | |
317 | === added file 'src/chassis-gtimeval.h' |
318 | --- src/chassis-gtimeval.h 1970-01-01 00:00:00 +0000 |
319 | +++ src/chassis-gtimeval.h 2010-02-26 08:20:32 +0000 |
320 | @@ -0,0 +1,34 @@ |
321 | +/* $%BEGINLICENSE%$ |
322 | + Copyright (C) 2010 Sun Microsystems, Inc |
323 | + |
324 | + This program is free software; you can redistribute it and/or modify |
325 | + it under the terms of the GNU General Public License as published by |
326 | + the Free Software Foundation; version 2 of the License. |
327 | + |
328 | + This program is distributed in the hope that it will be useful, |
329 | + but WITHOUT ANY WARRANTY; without even the implied warranty of |
330 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
331 | + GNU General Public License for more details. |
332 | + |
333 | + You should have received a copy of the GNU General Public License |
334 | + along with this program; if not, write to the Free Software |
335 | + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
336 | + |
337 | + $%ENDLICENSE%$ */ |
338 | + |
339 | +#ifndef __CHASSIS_GTIMEVAL_H__ |
340 | +#define __CHASSIS_GTIMEVAL_H__ |
341 | + |
342 | +#include <glib.h> |
343 | +#include "glib-ext.h" |
344 | + |
345 | +/** |
346 | + * stores the current time in the location passed as argument |
347 | + * if time is seen to move backwards, output an error message and |
348 | + * set the time to "0". |
349 | + * @param pointer to a GTimeVal struct |
350 | + * @return difference in usec between provided timestamp and "now" |
351 | + */ |
352 | + |
353 | +CHASSIS_API gint64 chassis_gtime_testset_now(GTimeVal *gt); |
354 | +#endif |
355 | |
356 | === modified file 'src/chassis-timings.c' |
357 | --- src/chassis-timings.c 2010-01-20 08:59:12 +0000 |
358 | +++ src/chassis-timings.c 2010-02-26 08:20:32 +0000 |
359 | @@ -1,5 +1,5 @@ |
360 | /* $%BEGINLICENSE%$ |
361 | - Copyright (C) 2009 Sun Microsystems, Inc |
362 | + Copyright (C) 2009-2010 Sun Microsystems, Inc |
363 | |
364 | This program is free software; you can redistribute it and/or modify |
365 | it under the terms of the GNU General Public License as published by |
366 | @@ -19,6 +19,7 @@ |
367 | #include <glib.h> |
368 | |
369 | #include "chassis-timings.h" |
370 | +#include "glib-ext.h" |
371 | |
372 | #define MICROS_IN_SEC 1000000 |
373 | |
374 | |
375 | === modified file 'src/glib-ext.c' |
376 | --- src/glib-ext.c 2009-11-11 16:58:44 +0000 |
377 | +++ src/glib-ext.c 2010-02-26 08:20:32 +0000 |
378 | @@ -1,5 +1,5 @@ |
379 | /* $%BEGINLICENSE%$ |
380 | - Copyright (C) 2007-2008 MySQL AB, 2008 Sun Microsystems, Inc |
381 | + Copyright (C) 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc |
382 | |
383 | This program is free software; you can redistribute it and/or modify |
384 | it under the terms of the GNU General Public License as published by |
385 | @@ -142,6 +142,20 @@ |
386 | return g_string_get_time(s, >); |
387 | } |
388 | |
389 | +/** |
390 | + * calculate the difference between two GTimeVal values, in usec |
391 | + * positive return means *told is indeed "earlier" than *tnew, negative |
392 | + * return means the reverse |
393 | + * Caller is responsible for passing valid pointers |
394 | + */ |
395 | +gint64 ge_gtimeval_diff(GTimeVal *told, GTimeVal *tnew) { |
396 | + gint64 diff; |
397 | + |
398 | + diff = (gint64) tnew->tv_sec - told->tv_sec; |
399 | + diff *= G_USEC_PER_SEC; |
400 | + diff += (gint64) tnew->tv_usec - told->tv_usec; |
401 | + return diff; |
402 | +} |
403 | |
404 | GString * g_string_assign_len(GString *s, const char *str, gsize str_len) { |
405 | g_string_truncate(s, 0); |
406 | |
407 | === modified file 'src/glib-ext.h' |
408 | --- src/glib-ext.h 2009-11-11 16:58:44 +0000 |
409 | +++ src/glib-ext.h 2010-02-26 08:20:32 +0000 |
410 | @@ -1,5 +1,5 @@ |
411 | /* $%BEGINLICENSE%$ |
412 | - Copyright (C) 2007-2008 MySQL AB, 2008 Sun Microsystems, Inc |
413 | + Copyright (C) 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc |
414 | |
415 | This program is free software; you can redistribute it and/or modify |
416 | it under the terms of the GNU General Public License as published by |
417 | @@ -41,6 +41,7 @@ |
418 | |
419 | CHASSIS_API int g_string_get_time(GString *s, GTimeVal *gt); |
420 | CHASSIS_API int g_string_get_current_time(GString *s); |
421 | +CHASSIS_API gint64 ge_gtimeval_diff(GTimeVal *old, GTimeVal *new); |
422 | CHASSIS_API GString *g_string_assign_len(GString *s, const char *, gsize ); |
423 | CHASSIS_API void g_debug_hexdump(const char *msg, const void *s, size_t len); |
424 | |
425 | |
426 | === modified file 'src/network-backend.c' |
427 | --- src/network-backend.c 2009-09-16 12:20:47 +0000 |
428 | +++ src/network-backend.c 2010-02-26 08:20:32 +0000 |
429 | @@ -1,5 +1,5 @@ |
430 | /* $%BEGINLICENSE%$ |
431 | - Copyright (C) 2008 MySQL AB, 2008 Sun Microsystems, Inc |
432 | + Copyright (C) 2008 MySQL AB, 2008-2010 Sun Microsystems, Inc |
433 | |
434 | This program is free software; you can redistribute it and/or modify |
435 | it under the terms of the GNU General Public License as published by |
436 | @@ -143,14 +143,23 @@ |
437 | GTimeVal now; |
438 | guint i; |
439 | int backends_woken_up = 0; |
440 | + gint64 t_diff; |
441 | |
442 | g_get_current_time(&now); |
443 | + t_diff = ge_gtimeval_diff(&bs->backend_last_check, &now); |
444 | |
445 | /* check max(once a second) */ |
446 | - if (bs->backend_last_check.tv_sec > 0 && |
447 | - now.tv_sec - bs->backend_last_check.tv_sec < 1) return 0; |
448 | - |
449 | - |
450 | + /* this also covers the "time went backards" case */ |
451 | + if (t_diff < G_USEC_PER_SEC) { |
452 | + if (t_diff < 0) { |
453 | + g_critical("%s: time went backwards (%"G_GINT64_FORMAT" usec)!", |
454 | + G_STRLOC, t_diff); |
455 | + bs->backend_last_check.tv_usec = 0; |
456 | + bs->backend_last_check.tv_sec = 0; |
457 | + } |
458 | + return 0; |
459 | + } |
460 | + |
461 | /* check once a second if we have to wakeup a connection */ |
462 | g_mutex_lock(bs->backends_mutex); |
463 | |
464 | |
465 | === modified file 'tests/unit/Makefile.am' |
466 | --- tests/unit/Makefile.am 2010-02-22 15:23:06 +0000 |
467 | +++ tests/unit/Makefile.am 2010-02-26 08:20:32 +0000 |
468 | @@ -1,3 +1,21 @@ |
469 | +# $%BEGINLICENSE%$ |
470 | +# Copyright (C) 2009-2010 Sun Microsystems, Inc |
471 | +# |
472 | +# This program is free software; you can redistribute it and/or modify |
473 | +# it under the terms of the GNU General Public License as published by |
474 | +# the Free Software Foundation; version 2 of the License. |
475 | +# |
476 | +# This program is distributed in the hope that it will be useful, |
477 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
478 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
479 | +# GNU General Public License for more details. |
480 | +# |
481 | +# You should have received a copy of the GNU General Public License |
482 | +# along with this program; if not, write to the Free Software |
483 | +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
484 | +# |
485 | +# $%ENDLICENSE%$ |
486 | + |
487 | SUBDIRS=lua |
488 | |
489 | TESTS=\ |
490 | @@ -76,6 +94,7 @@ |
491 | t_chassis_timings_SOURCES = \ |
492 | t_chassis_timings.c \ |
493 | $(top_srcdir)/src/chassis-timings.c \ |
494 | + $(top_srcdir)/src/glib-ext.c \ |
495 | $(top_srcdir)/src/my_rdtsc.c |
496 | |
497 | t_chassis_timings_CPPFLAGS = -I$(top_srcdir)/src/ $(GLIB_CFLAGS) |
498 | @@ -151,6 +170,7 @@ |
499 | |
500 | t_network_backend_SOURCES = \ |
501 | t_network_backend.c \ |
502 | + $(top_srcdir)/src/chassis-timings.c \ |
503 | $(top_srcdir)/src/glib-ext.c \ |
504 | $(top_srcdir)/src/network-backend.c \ |
505 | $(top_srcdir)/src/network-mysqld-proto.c \ |
506 | @@ -158,7 +178,8 @@ |
507 | $(top_srcdir)/src/network-conn-pool.c \ |
508 | $(top_srcdir)/src/network-address.c \ |
509 | $(top_srcdir)/src/network-queue.c \ |
510 | - $(top_srcdir)/src/network-socket.c |
511 | + $(top_srcdir)/src/network-socket.c \ |
512 | + $(top_srcdir)/src/my_rdtsc.c |
513 | |
514 | t_network_backend_CPPFLAGS = -I$(top_srcdir)/src/ $(GLIB_CFLAGS) $(MYSQL_CFLAGS) $(GMODULE_CFLAGS) $(EVENT_CFLAGS) $(LUA_CFLAGS) |
515 | t_network_backend_LDADD = $(GLIB_LIBS) $(GMODULE_LIBS) $(GTHREAD_LIBS) $(EVENT_LIBS) $(LUA_LIBS) |
rebased, fixed the conflicts against the current trunk and pushed over