Patch fixes following situation:
1. objdb receives reload notification and ends in function
object_reload_config. This will call objdb_wrlock. I will call this
thread #1
2. Another thread will decide to update corosync statistics and calls
object_key_increment. This calls objdb_rdlock. This thread is #2. But
because condition (lock_thread != pthread_self()) is satisfied, it will
also calls pthread_rwlock_rdlock. This will blocks, because thread #1
holds the lock.
3. object_reload_config will call reload functions (as real example
xml2objdb). xml2objdb needs to calls object_create. This calls
objdb_rdlock, but will hang on pthread_mutex_lock(&meta_lock), because
this lock is held by thread #2.
-> deadlock
It is handled by using recursive mutex.
Also every function is now really locked.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2963 fd59a12c-fef9-0310-b244-a6a79926bd2f
- Memset for res_setup variable in coroipcs:req_setup_send
- Two memset in logsys for buffers
- Problem in corosync_totem_stats_updater where avg_token_holdtime has
size of avg_backlog_calc
- corosync_totem_stats_init where avg_backlog_calc is 32 bits (not 64)
- objdb problem if new_valie_len != object->value_len. In such case
newly allocated memory is not initialized and in some situations,
value_len is not updated.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2787 fd59a12c-fef9-0310-b244-a6a79926bd2f
1) don't send notifications if the key is the same.
2) Add key value change notifications to key_inc & key_dec
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2746 fd59a12c-fef9-0310-b244-a6a79926bd2f
1. the reload callback was not sent to the library,
2. totem exponentially added new callbacks because the old ones were not
removed properly.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2684 fd59a12c-fef9-0310-b244-a6a79926bd2f
reload_notifications callbacks. This allows callback functions to
manipulate the notifications list without causing corruption or strange
loops.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2380 fd59a12c-fef9-0310-b244-a6a79926bd2f
This could probably be more tidy to detect those OS platforms which don't do this instead of hardcoding
to a specific platform we intend to port to.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2221 fd59a12c-fef9-0310-b244-a6a79926bd2f
- services/Makefile.am: add include search paths for config.h
- include/corosync/cs_config.h.in exports LCRSODIR and SOCKETDIR
- tools/Makefile.am: drop -D defines for dirs that are now in
cs_config.h or config.h
- configure.ac: sanitize prefix and exec_prefix paths. Export DIRS in
*config.h
- lib/Makefile.am: : drop -D defines for dirs that are now in
cs_config.h or config.h. Add rule to build lcr_ifact.o or building from
lib/ fails miserably
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1877 fd59a12c-fef9-0310-b244-a6a79926bd2f
is a bit of a nightmare to manage and provides no useful functionality
that I can see. Making keys unique has been discussed on IRC several
times and there seem to be no objections...so here is the patch:
Note that I have removed some now-useless parameters from the objdb API
too.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1783 fd59a12c-fef9-0310-b244-a6a79926bd2f
The objdb occurred because object_find_destroy wasn't implemented!
The one in confdb occurred because object_find_destroy wasn't called if
object_find_next returned an error the first time it was invoked (ie
there were no subobjects).
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1741 fd59a12c-fef9-0310-b244-a6a79926bd2f
coverity says that in exec/objdb.c: 1075 the found is always == 1
therefore the code is dead. But this is just a case of an overused
local variable. "found" is used for two different searches.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1716 fd59a12c-fef9-0310-b244-a6a79926bd2f
If the new length is larger then memory will be overwritten.
I could make this ">=" but we can save memory if the new size is smaller by using "!=".
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1680 fd59a12c-fef9-0310-b244-a6a79926bd2f
notifications will get a RELOAD_NOTIFY_START callback but not a
RELOAD_NOTIFY_END callback.
This patch adds a RELOAD_NOTIFY_FAILED callback so that interested
parties will know when the reload has finished and that it failed.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1678 fd59a12c-fef9-0310-b244-a6a79926bd2f
Also add a notification callback for reload. Both the start and the stop
are notified so that the user can decide what to do with the flurry of
updates that occur.
Note than the reload callback notification MUST be registered against
OBJECT_PARENT_HANDLE. Registering it lower down the hierarchy makes no sense.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1673 fd59a12c-fef9-0310-b244-a6a79926bd2f
confdb subsystems.
This is useful to provide atomic counters (ag handle numbers) for
long-running (though not persistent) connections. It's not currently
possible via confdb to atomically get a new number from objdb due to the
lack of locking. Doing it via increment operations in the IPC thread
provides enough atomicity to make it useful. Fabio has already
identified a use for these calls.
It could also provide some form of basic co-operative locking mechanism
for IPC-using processes (not direct objdb calls).
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1662 fd59a12c-fef9-0310-b244-a6a79926bd2f
the confdb library to use the new find_create/find_next/find_destroy API
calls instead.
I've kept the libcondfb API the same as before with the single change of
adding a confdb_object_find_destroy to tidy up the find handle after
use. If you don't call this then libcondfb will do it for you when
confdb_finalize is called.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1660 fd59a12c-fef9-0310-b244-a6a79926bd2f
Use a 2 phase "commit" operation:
1) Invoke verifyconfig that should catch the errors before the reload operation
2) Invoke reloadconfig that performs the operation and should _never_ fail
Implementation note: if step 2 fails, there is no fall back at the moment.
Fix the IPC table for confdb:
MESSAGE_REQ_CONFDB_XPATH_EVAL_EXPRESSION = 12 was added to include/ipc_confdb.h
without an associated call. Thanks Chrissie for spotting this.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1629 fd59a12c-fef9-0310-b244-a6a79926bd2f
These allow replacing/removing keys, and deleting a whole object subtree,
iterator functions to enumerate all objects/keys on an object,
and a dump call for debugging.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1505 fd59a12c-fef9-0310-b244-a6a79926bd2f