Commit Graph

52 Commits

Author SHA1 Message Date
Steven Dake
2f24513d87 Fix coroipcs message corruption that occurs when a message fills the remainder
of the dispatch buffer with a full message.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2650 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-01-30 23:02:40 +00:00
Jan Friesse
64c6c6f324 Fix malloc deadlock in signal handler
This patch solves situations, where malloc is called 
inside signal handler. It creates thread, which waits
for semaphore unlock and then starts shutdown sequence.

RHBZ#547511


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2644 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-01-14 12:54:46 +00:00
Angus Salkeld
acf9a8d85f Correct some ugly indentation.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2563 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-12-03 18:13:52 +00:00
Angus Salkeld
27d383276b coroipcs: Add a queue_size stats counter to each ipc connection.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2552 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-11-29 18:28:39 +00:00
Angus Salkeld
ce8046f353 coroipcs: add logging for flow control state changes.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2551 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-11-29 18:25:51 +00:00
Angus Salkeld
e5b94a352e COVERITY 14: free zcb_mapped if memory_map() fails.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2544 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-11-22 06:27:09 +00:00
Angus Salkeld
07072bd0b1 Add a log_printf function to coroipcs so we can pass the log level
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2530 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-10-18 18:15:24 +00:00
Angus Salkeld
494bf45ebf Avoid array out of bound error.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2529 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-10-14 23:05:18 +00:00
Steven Dake
765fa65351 Patch from jflesch to fix segfault when using sysv semaphores that the thread
state is checked prior to the semaphore operation, not after it has completed.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2524 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-10-14 19:06:37 +00:00
Angus Salkeld
97ed934966 Fix the OSX build (broken by stats patches)
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2521 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-10-13 08:13:53 +00:00
Angus Salkeld
948ca19aa7 Add some missing calls to increment the relevant stats.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2519 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-10-12 21:56:23 +00:00
Angus Salkeld
4e6e33467d allow coroipcs to work without calling stats initialization.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2518 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-10-12 21:50:10 +00:00
Angus Salkeld
afbbc5e5ff Add connection related statistics to the object db.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2514 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-10-12 00:36:55 +00:00
Christine Caulfield
898790d501 Return CS_ERR_NOT_EXIST if a client tries to contact a plugin that isn't loaded.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2403 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-09-07 07:28:25 +00:00
Jan Friesse
55db0b67a2 Fix systems without _POSIX_THREAD_PROCESS_SHARED
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2390 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-08-19 09:55:49 +00:00
Steven Dake
f558917703 Proper limits checking for message sizes to allow ~1mb max message sizes for corosync.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2388 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-08-17 18:22:11 +00:00
Steven Dake
ee7ce5e328 Use unnamed shared posix semaphores on platforms which support them.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2379 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-08-04 00:22:41 +00:00
Jrme Flesch
483fe491f9 BSD support: Fix EOF handling in coroipcs.c:req_setup_recv() and coroipcs:coroipcs_handler_dispatch()
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2345 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-07-02 07:47:04 +00:00
Steven Dake
c12253097f Send ERR_SECURITY when invalid security context is provided via ipc clients.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2338 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-07-01 20:04:20 +00:00
Steven Dake
0cf6c6c7db Add tests for posix scheduling apis to configure.ac and use them to determine
if we should set scheduling priorities or not.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2277 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-06-21 16:33:25 +00:00
Steven Dake
74c0a68ee1 Fix unused variable on linux because of portage work.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2268 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-06-19 15:53:13 +00:00
Steven Dake
589f889fbe Patch from Wojtek to fix Solaris segfault with compiler optimization.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2267 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-06-19 15:42:15 +00:00
Jim Meyering
74a2fa1194 maint: remove trailing blanks
By running this command from a git-cloned directory:
git grep -z -l -E '[[:blank:]]+$' | xargs -0 perl -pi -e 's/[ \t]+$//'

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2266 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-06-19 11:34:50 +00:00
Steven Dake
2d7937de26 Warn user of missing dirs and exit gracefully.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2262 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-06-19 01:53:24 +00:00
Steven Dake
4620ca4e0b Ensure Linux, BSD, Solaris, Darwin function with security authentication in
IPC system.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2259 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-06-18 21:32:45 +00:00
Steven Dake
a49937b029 add madvise nosync calls for bsd platform.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2253 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-06-18 05:53:16 +00:00
Steven Dake
4c4b980d6b Fix build error from recent solaris porting.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2241 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-06-15 18:39:50 +00:00
Steven Dake
0389b65725 Port of coroipc system to Solaris.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2238 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-06-14 11:36:18 +00:00
Steven Dake
13f3f6214d Patch from Jerome Flesch to correctly reference count on bsd and solaris
platforms in the IPC system to avoid cpu spinning.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2237 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-06-14 10:40:50 +00:00
Steven Dake
ae8fd0a6e0 Fix semun definitions for various platforms.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2228 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-06-10 14:28:16 +00:00
Steven Dake
0d98fca548 Use PF_LOCAL to match BSD semantics of api calls.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2226 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-06-09 21:40:44 +00:00
Steven Dake
e94bcd506e Make coroipcs compile on Solaris.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2212 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-06-07 00:55:00 +00:00
Steven Dake
0986c30320 Remove useless APIs from coroipcs.c related to handling of overload
conditions.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2146 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-26 01:20:09 +00:00
Steven Dake
589d2ae1af coroipcs.h cleanup.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2132 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-23 16:13:24 +00:00
Steven Dake
8126cf7458 Reworking of include file dependencies.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2119 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-22 09:01:30 +00:00
Jim Meyering
904a10ed38 remove all trailing blanks
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2117 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-22 08:03:55 +00:00
Steven Dake
cee464489f Change shared memory to use mmap() system calls.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2115 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-22 05:41:30 +00:00
Steven Dake
75c4bc0d71 Zero copy feature for IPC transmits. Also integrated into CPG library
service.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2114 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-21 23:37:49 +00:00
Steven Dake
6951637ea5 Remove memory leak from new dispatch circular buffer mapped system.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2113 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-21 20:26:12 +00:00
Fabio M. Di Nitto
c3c75acfd2 Add logsys v3
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2091 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-20 04:28:33 +00:00
Steven Dake
0969721db3 Rework how dispatch functions so service engines work properly.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2079 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-18 07:06:14 +00:00
Jim Meyering
bf926d30f0 coroipcs.c: don't shadow functions read and write
* exec/coroipcs.c (req_setup_recv): rename locals:
s/read/n_read/; s/write/n_write.
Also declare param to be const.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2071 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-15 19:12:40 +00:00
Steven Dake
0135d41ea1 Cast a const away in an iovector.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2056 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-10 03:10:24 +00:00
Jim Meyering
3df307a36d sync the rest of the code with previous header changes
* exec/coroipcs.c (coroipcs_response_send)
(coroipcs_dispatch_send):
* exec/coroipcs.h (handler_fn_get):
* include/corosync/cpg.h (cpg_deliver_fn_t, cpg_confchg_fn_t):
* test/cpgbench.c (cpg_bm_confchg_fn, cpg_bm_deliver_fn):
* test/testcpg.c (print_cpgname, DeliverCallback)
(ConfchgCallback):
* test/testcpg2.c (deliver, confch):

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2044 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-08 17:29:53 +00:00
Jim Meyering
36eefbadef Convert all "int iov_len" decls to "unsigned int iov_len".
Used this command:
git grep -l 'int iov_len' \
  | xargs perl -pi -e 's/((?:^|,)\s*)(int iov_len)/${1}unsigned $2/'

Here's an approximate (autogenerated by vc-chlog) list of affected
file names and functions/macros:
* README.devmap:
* exec/coroipcs.c (sending_allowed_private_data)
(coroipcs_response_iov_send, msg_send, msg_send_or_queue)
(coroipcs_dispatch_iov_send):
* exec/coroipcs.h (handler_fn_get):
* exec/main.c (deliver_fn, main_mcast):
* exec/main.h (FALSE):
* exec/sync.c (vsf_iface, sync_deliver_fn):
* exec/totemmrp.c (totemsrp_handle_in, pg_deliver_fn)
(totemmrp_deliver_fn, totemmrp_initialize, totemmrp_mcast):
* exec/totemmrp.h (TOTEMMRP_H_DEFINED):
* exec/totemnet.c (iov_len, encrypt_and_sign_worker)
(ucast_sendmsg, mcast_sendmsg, totemnet_token_send):
* exec/totemnet.h (TOTEMNET_FLUSH):
* exec/totempg.c (deliver_fn, totempg_deliver_fn, mcast_msg)
(totempg_groups_initialize, totempg_groups_mcast_joined)
(totempg_groups_joined_reserve):
* exec/totemsrp.c (iov_len, totemsrp_recv, totemsrp_deliver_fn)
(totemsrp_initialize, totemsrp_mcast, token_send):
* exec/totemsrp.h (TOTEMSRP_H_DEFINED):
* exec/vsf_ykd.c (ykd_deliver_fn):
* include/corosync/coroipcc.h (handleInstanceDestructor):
* include/corosync/cpg.h (cpg_callbacks_t):
* include/corosync/engine/coroapi.h (ipc_response_iov_send)
(ipc_dispatch_iov_send, totem_mcast, tpg_init, tpg_joined_mcast)
(tpg_joined_reserve, tpg_groups_mcast, tpg_groups_reserve):
* include/corosync/totem/totempg.h (TOTEMPG_SAFE):
* lib/coroipcc.c (coroipcc_msg_send)
(coroipcc_msg_send_reply_receive)
(coroipcc_msg_send_reply_receive_in_buf):
* lib/cpg.c (cpg_mcast_joined):
* lib/util.h (versionsSupported):
* services/pload.c (send_message):
* services/votequorum.c (conn, quorum_deliver_fn):

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2031 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-08 07:56:45 +00:00
Jim Meyering
41b1ba0e77 remove 3 useless casts
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2005 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-03 20:31:45 +00:00
Jim Meyering
f42de14a5a coroipcs.[ch]: remove 4 const-related warnings
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1924 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-03-30 21:10:37 +00:00
Jim Meyering
2344e2f1b8 cfg.c: nearly warning-free
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1918 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-03-30 21:09:47 +00:00
Steven Dake
e77b1e21ad Make all threads use same scheduling priority even with -p option
specified to avoid deadlock in spinlocks.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1912 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-03-25 18:25:18 +00:00
Christine Caulfield
200fe649c7 Fix IPC when running on mac OS/X
Note that OS/X seems to be rather stingy about its IPC resources, so if things
crash you will probably have to clean up before starting it all again.



git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1911 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-03-25 15:54:31 +00:00