Commit Graph

460 Commits

Author SHA1 Message Date
Angus Salkeld
0ad2494ae7 Fix some "set but not used" warnings [-Wunused-but-set-variable]
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-03-16 07:13:42 +11:00
Russell Bryant
e5456008d0 Resolve a couple of doxygen warnings.
This resolves a couple of doxygen warnings.  First, the group needed a
name.  Second, all of the functions in the file were added to the group
but doxygen complained about the lack of an end to the grouping.

Signed-off-by: Russell Bryant <russell@russellbryant.net>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-03-07 08:39:58 -06:00
Angus Salkeld
89e4c1c048 CONFDB: add confdb_object_name_get()
This is useful when tracking object changes.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Seven Dake <sdake@redhat.com>
2011-02-04 09:47:15 -07:00
Angus Salkeld
e0cce2c907 CPG: make sure coroipcc_service_disconnect() is always called.
This prevents a shared mem leak if corosync dies while clients
are connected.

Calling cpg_finalize() did not release the shared mem as
coroipcc_msg_send_reply_receive() returned an error and
thus coroipcc_service_disconnect() did not get called.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-01-03 21:29:01 +11:00
Angus Salkeld
83b24b660b WD/SAM integration.
- timestamps -> uint64_t and in nanosecs
- use clock_gettime
- common object naming
- common state names
- timeouts in milliseconds



git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@3054 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-09-27 21:13:15 +00:00
Jan Friesse
1a32fc4a6c SAM Confdb integration
Patch add support for Confdb integration with SAM. It's now possible to
use SAM_RECOVERY_POLICY_CONFDB as flag to previous policies.
    
Also new function sam_mark_failed is added for ability to use RECOVERY
policy together with confdb and get expected results (specially with
integration with corosync watchdog)

Patch also makes SAM thread safe.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@3050 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-09-27 07:34:21 +00:00
Steven Dake
4ac55e52e4 Patch from Kacper Kowalik to support honoring user defined LDFLAGS.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@3042 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-09-14 18:10:12 +00:00
Angus Salkeld
3b320c17ae IPC: return CS_ERR_NO_RESOURCES to library when low on fds.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@3029 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-08-25 01:13:14 +00:00
Steven Dake
5a3c285fbd Properly detect shutdown of corosync process
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@3022 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-08-17 18:08:13 +00:00
Steven Dake
1135c911cd Fix problem where flow control could lock up ipc under very heavy load in very
rare circumstances.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@3001 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-07-21 17:03:36 +00:00
Steven Dake
10fcf89591 Speed up IPC connection process.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2986 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-07-07 21:43:15 +00:00
Steven Dake
cf0d63aa3f Patch to fix stack protector sig abort that occurs when ipc buffer is too
short.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2974 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-06-29 18:15:20 +00:00
Angus Salkeld
b116eaca00 ipc: Fix error handling of mmap util functions.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2972 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-06-29 05:31:44 +00:00
Jan Friesse
1d1c3059ad coroipcc - don't loop forever on EINTR
This patch unify behaviour of SYS V semaphores and POSIX semaphores.
POSIX semaphores never return CS_ERR_TRY_AGAIN on EINTR and keeps
waiting. This was fixed for SYS V semaphores in rev. 2303.

Another change is to remove very small probability of hung forever in
coroipcc_dispatch_put.

Last change is removal of duplicate code by adding ipc_sem_wait function.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2907 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-05-27 08:05:31 +00:00
Steven Dake
0e9f0bfeb4 Make cpg_membership_get() functional.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2855 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-05-19 05:03:52 +00:00
Steven Dake
02cddf6854 Fix free of ring status information when memory allocation fails during
allocation of the ring status information.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2852 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-05-18 17:20:05 +00:00
Angus Salkeld
b1d84f9ecc cov 10373: check poll return value
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2844 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-05-16 23:35:45 +00:00
Angus Salkeld
b2a304d8f8 cov (10387, 10397): cleanup memory mapping functions
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2840 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-05-16 21:35:52 +00:00
Angus Salkeld
0886c03881 cov 10374: check sam_hc_send() before counter++
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2839 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-05-16 21:34:41 +00:00
Angus Salkeld
d146ae8ec9 cov 10396: prevent a leak under error conditions (lib/sam.c)
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2830 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-05-14 02:08:30 +00:00
Jan Friesse
d5884cd714 SAM integration of quorum
Patch adds integration of SAM and quorum, so it's now possible to use
SAM_RECOVERY_POLICY_QUORUM_QUIT or SAM_RECOVERY_POLICY_QUORUM_RESTART
recovery policy. With these policies, sam_start will block until
corosync is quorate. If quorum is lost during health checking, recovery
action is taken.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2822 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-05-13 11:20:49 +00:00
Jan Friesse
088a2a0f17 Allow call sam_warn_signal_set after sam_register
Patch fixes situation, when user want to change warn signal after
call of sam_register function. This was not possible, because parent
process never got new value from child.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2821 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-05-13 11:19:52 +00:00
Angus Salkeld
1cdad3104c Fix "mock --with testagents"
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2798 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-05-04 00:50:24 +00:00
Jan Friesse
450d821bdf Fix parallel build of libs in lib directory
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2790 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-04-28 16:00:55 +00:00
Jan Friesse
171f65578c Handle POLLNVAL in coroipcc
Old code in coroipcc doesn't handle POLLNVAL. It can happen, that some
applications (for example fenced) will stuck forever.

Also poll result is now handled more correctly.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2789 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-04-26 16:16:20 +00:00
Jan Friesse
e8b143595c CPG model_initialize and ringid + members callback
Patch adds new function to initialize cpg, cpg_model_initialize. Model
is set of callbacks. With this function, future addions of models
should  be possible without changing the ABI.

Patch also contains callback in CPG_MODEL_V1 for notification about
Totem membership changes.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2770 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-04-20 12:40:48 +00:00
Jan Friesse
da6fce352b Support for store user data in SAM
Ability to in-memory storing of user data which survives between
instances of process.

Also ability needed ability for bi-directional communication between
child and parent is added.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2769 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-04-20 10:32:07 +00:00
Jan Friesse
2a12dafffb Fix confdb linking (add -ldl)
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2768 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-04-20 10:08:15 +00:00
Steven Dake
5408399b23 Remove problem where NULL dispatch handler functions would result in lockup
of the dispatch if they were sent by a service engine.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2754 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-04-02 00:10:43 +00:00
Jan Friesse
a568462601 Support for user configurable warning signal
Allow developer configure a signal to be send as a warning signal
before real SIGKILL.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2753 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-04-01 12:51:07 +00:00
Jan Friesse
4b18364c61 Support for specific libraries version
Patch adds support for changing version number of library simply by edit
lib$(LIB).verso file.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2752 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-04-01 12:35:31 +00:00
Jrme Flesch
52acd736d0 Coroipcc: Make sure that coroipcc_service_connect() always return a valid cs_error_t
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2748 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-03-30 07:24:59 +00:00
Christine Caulfield
1baa7b2ab3 Add a reload callback to libconfdb.
This also increments the libconfdb version to 4.1.0



git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2683 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-03-16 09:51:30 +00:00
Jan Friesse
009dfc090e Support for lib_cpg_finalize
Add support for MESSAGE_REQ_CPG_FINALIZE message. This will allow us
remove cpg_pd from list of active connections, and remove problem, when
cpg_finalize + cpg_initialize + cpg_join can result in CPG_ERR_EXIST
error.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2676 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-03-04 12:17:47 +00:00
Steven Dake
3dd78c7aec Fix error handling to avoid segfaults/leaks on error in coroipcc_service_connect.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2672 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-03-03 19:19:12 +00:00
Angus Salkeld
5dd31150ee convert strtok to strtok_r
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2663 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-02-25 19:25:20 +00:00
Jan Friesse
1649931691 Fix freeze of IPC library connection on sem_wait
This patch solves library waiting on sem_wait. It doesn't
solve all other problems, which can make corosync not
to exit (malloc race, global lock deadlock, ...)

RHBZ#547511


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2643 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-01-14 08:39:06 +00:00
Jan Friesse
0ed4d53083 SAM implementation merge
The SAM library provide a tool to check the health
of an application. The main purpose of SAM is to restart
a local process when it fails to respond to a healthcheck
request in a configured time interval.



git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2570 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-12-07 17:06:53 +00:00
Angus Salkeld
663f894498 make sure key_names past from confdb are null terminated.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2561 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-12-02 22:14:00 +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
3848fc2069 COVERITY 4: remove dead code in XYZ_dispatch().
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2549 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-11-23 00:32:31 +00:00
Angus Salkeld
870e4549df COVERITY 11: remove dead code from cpg_iteration_next().
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2545 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-11-22 06:29:46 +00:00
Angus Salkeld
73b7aa19bb Add value types to objdb keys.
This allows you to create a key with a know type.
And then get the type with the key value.



git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2511 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-10-10 03:20:38 +00:00
Steven Dake
45d68cab47 Fix merge error in previous commit.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2472 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-09-21 20:08:38 +00:00
Steven Dake
b3f661d295 Patch from Jerome to fix segfault in dispatch functions.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2468 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-09-21 19:03:16 +00:00
Steven Dake
77e63f0044 Remove warning in coroipcc.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2462 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-09-20 06:53:10 +00:00
Steven Dake
f170a431ce Fix error with revision 2415.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2416 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-09-14 20:27:45 +00:00
Steven Dake
c14c130df5 Fix dispatch returning TRY_AGAIN when using DISPATCH_ALL parameter because of
regression caused by revision 2046:lib/coroipcc.c.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2415 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-09-14 18:58:08 +00:00
Angus Salkeld
b13a7aba13 add small-memory-footprint option to configure
This adds the following option to configure:
--enable-small-memory-footprint

When enabled the following defines are set
to reduce the overall memory footprint.

MESSAGE_SIZE_MAX=1024*64
MESSAGE_QUEUE_MAX=512
PROCESSOR_COUNT_MAX=16
IPC_REQUEST_SIZE=1024*64
IPC_RESPONSE_SIZE=1024*64
IPC_DISPATCH_SIZE=1024*64




git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2410 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-09-09 18:58:38 +00:00
Christine Caulfield
6f3fabe398 Add corosync-quorumtool
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2406 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-09-08 08:14:58 +00:00