Commit Graph

822 Commits

Author SHA1 Message Date
David Vossel
2b11b783c7 High: ipcs: Api function allowing server to retrieve client connection's ipc buffer size 2013-10-08 17:11:53 -05:00
David Vossel
47c690dbbc Low: ringbuffer: Abort during chunk reclaim if OVERWRITE flag is set and reclaim fails. 2013-10-03 20:40:12 -05:00
David Vossel
9582a4c60a High: blackbox: unique blackbox ringbuffer files per pid 2013-10-03 19:24:41 -05:00
David Vossel
b327dbec73 Low: ipc_socket: Fixes fd leak in socket ipc client disconnection 2013-09-16 18:38:20 -05:00
Michael van der Westhuizen
57e630f63f Use sizeof to get the correct size of the sockaddr_un sun_path member in a portable way. Fixes corosync on Mac OS X. 2013-09-03 08:44:15 +02:00
David Vossel
1bf8856b00 Merge pull request #87 from anchor/del-during-dispatch-v2
Avoid double-decrement of level->todo
2013-08-20 06:02:00 -07:00
David Vossel
67f63be685 Detect the max signal value that can be used using NSIG macro 2013-08-19 20:44:10 -05:00
Michael Chapman
580ca05de3 Avoid double-decrement of level->todo
If a job's dispatch function deletes the job, we may end up decrementing
the job queue's todo count twice. Verify that the job is on the queue
before decrementing.
2013-08-20 09:30:16 +10:00
Michael van der Westhuizen
4509500e5e Use a system-supplied maximum number of signals on Mac OS X. This gets SIGUSR2 (#31) working. 2013-08-11 21:51:17 +02:00
David Vossel
75f7ed3737 Bump version to 0.16.0 ... do not use version 0.15.0
The use of version-info conflicted with the naming
convention used to represent libqb version numbers. Because
of this the shared library file used for release 0.15.0
did not properly match the release version.  From now on
the version number will be manually set to guarantee consistency
between .so file and release version.
2013-07-25 13:12:02 -05:00
David Vossel
986b92d391 Bump the version to 0.15.0 2013-07-24 18:04:39 -05:00
David Vossel
2a0a0790e9 Low: ipc_socket: Output send event failure as debug instead of error 2013-07-23 22:37:08 -05:00
David Vossel
54ef796126 High: ipc_socket.c: Detect EOF connection on connection STREAM socket 2013-07-23 20:01:41 -05:00
David Vossel
e6c99f6280 Merge pull request #81 from davidvossel/dgram_max_msg
Added ability to estimate kernel's actual max dgram buffer size in a portable way.
2013-07-22 14:04:52 -07:00
David Vossel
a881c14086 Low: ipc_socket.c: Handle the unlikely event of an EAGAIN or EINTR during dgram max size detection 2013-07-22 20:29:24 -05:00
David Vossel
c73f2aa5cc Fixes sem leak 2013-07-22 18:21:23 -05:00
David Vossel
c04e887cf1 fixes double close 2013-07-22 16:58:46 -05:00
David Vossel
f14be872a1 Fixes double close 2013-07-22 16:57:47 -05:00
David Vossel
9102c8d956 Fixes double fd close 2013-07-22 16:54:52 -05:00
David Vossel
bb4958a8c0 Fixes fd leak 2013-07-22 16:11:15 -05:00
David Vossel
a6b41b2738 Fixes use ater free in shm disconnect 2013-07-22 15:56:30 -05:00
David Vossel
73827cfc5a Fixes use after free during ipcs client disconnect 2013-07-22 15:50:04 -05:00
David Vossel
70a7aca77f Remove dead code 2013-07-22 15:43:54 -05:00
David Vossel
65d044be18 High: ipcc: Add abilty to verify dgram kernel buffer size meets max msg value 2013-07-19 18:51:59 -05:00
David Vossel
40e163adba Fixes travis build error 2013-07-19 14:15:34 -05:00
David Vossel
bde8496352 High: ringbuffer: Make max_size of ringbuffer accurate so shm ipc max msg size value is honored 2013-07-18 22:01:29 -05:00
David Vossel
6cf5a3b3db Low: ipcs: For shm ipc, always retry outstanding notifications when next event is sent 2013-07-18 21:59:59 -05:00
David Vossel
71979d7796 Fix: ipcs: Fixes compile time issue reported by travis 2013-07-12 21:58:51 -05:00
David Vossel
0dc7003d08 Low: loop_pool_kqueue: remove potentially noisy dbug statement 2013-07-12 21:21:17 -05:00
David Vossel
6a1186863f Low: ipc_socket: In fbsd send() returns ENOBUFS when dgram queue is full, this should be treated similar to EAGAIN 2013-07-12 19:04:47 -05:00
David Vossel
0e44129344 High: kqueue: Properly enable kqueue filter in poll loop 2013-07-12 19:04:42 -05:00
David Vossel
be975f9de0 Low: ipcs: Attempt to resend outstanding event notifications during event send 2013-07-12 18:45:21 -05:00
David Vossel
ff180f7a55 Fix: ipcs: Disconnect shm ipc connection when poll socket returns error on msg receive 2013-07-01 19:20:51 -05:00
David Vossel
95e48fdb76 Fix: ipcs: Properly disconnect client connection on POLLNVAL or any other error causing connection removal from mainloop.
qb_ipcs_dispatch_connection_request is a callback function registered with
mainloop, or whatever other looping thread implementation is in use.  When
this callback is registered, a reference of the connection object is given
to the mainloop thread.  If this callback ever returns something none zero
the callback (and corresponding fd) is unregistered from the loop automatically,
so we must decrement the reference in this instance.

Since unregistering this callback from mainloop guarantees a disconnect
simply because requests on the fd are no longer processed, it is best
that we completely disconnect the connection (which will handle the unref)
when this callback returns an error... Otherwise since the fd is unregistered
from the mainloop thread, it may not be possible to detect a disconnect
in the future.
2013-07-01 18:46:31 -05:00
David Vossel
abdf8cd94a Simplify internal ipcs ref counting, add comments and document api behavior 2013-06-28 20:27:02 -05:00
David Vossel
8466fba749 Simplifies connection ref counting without changing behavior 2013-06-28 20:26:24 -05:00
David Vossel
a8d4e9fdb5 Fix: refcount leak 2013-06-27 19:33:18 -05:00
David Vossel
a2bdeed3cc Fix: ringbuffer: Add file header version field and detect reading corrupted blackbox files using hash value
In the future, if something changes in the file header we can
increment the version and split up the parsing into separate functions
for backwards compatibility.
2013-06-27 19:32:05 -05:00
yuusuke
9b7b16a865 fix a problem when the character string beyond the number of the maximum characters is passed 2013-06-05 19:35:03 +09:00
Michael van der Westhuizen
652766c002 Add a IPC service context pointer and accessors from both the connection and service level. 2013-05-25 22:57:53 +01:00
Angus Salkeld
359725f4fd Add atomic_int.h to noinst_HEADERS
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2013-05-13 11:59:42 +10:00
Angus Salkeld
67dc29f48d Use the new atomic ops in the ringbuffer
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2013-05-13 10:15:55 +10:00
Angus Salkeld
6f382aaade Add internal support for the new __atomic gcc builtins
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2013-05-13 10:15:55 +10:00
Angus Salkeld
d782f4216b Rename the configure macros from atomic to sync
This is so I can add support for the new atomic's which
are named __atomic.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2013-05-13 09:45:50 +10:00
Jeremy Fitzhardinge
9b3be0b450 ringbuffer: use atomic ops on ringbuffer chunk magic
The ringbuffer protocol uses the chunk magic number to indicate to the
other side what state a chunk is in.  It's therefore important to use
strongly ordered memory writes to make sure that neither the compiler
nor the CPU change the apparent order of the writes, since that would
result in corrupted messages.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2013-04-24 11:57:49 +10:00
Angus Salkeld
f54764e1ec IPC: make each connection ref the owning service
This is because the connection functions use the c->service pointer
and this needs to be mirrored in the reference counting.

The service can only be free'd when all connections are destroyed
and the user as unreferenced all previously referenced connections
and the service.

Fixes #62
Thanks to Jan Friesse for the reproducer
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2013-04-22 12:03:26 +10:00
Andrew Beekhof
f16dca6df9 Indicate when/why qb_rb_force_close() fails to remove share memory files 2013-04-11 13:00:12 +10:00
Angus Salkeld
7667536626 Deal better with corrupt blackbox files.
fixes #59
Thanks to Jan Friesse for the reproducer.
https://github.com/jfriesse/csts/blob/master/tests/fplay-segfault.sh

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2013-04-02 13:52:57 +11:00
Kazunori INOUE
1894470470 IPC: fix the connection state checking 2013-03-22 15:46:00 +09:00
Angus Salkeld
1c9104e334 LOG: copy the function/filename for dynamic callsites
callsites originate from the assumption that the function/filename/format
are all statically allocated. When moving to dynamic callsite we kept
this assumption. But people are now passing in function/file names that
later get free'd. So we need to make sure that they stay persistant by
allocating them ourselves.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2013-03-20 17:10:35 +11:00
Angus Salkeld
c445c06620 Properly discover SO_NOSIGPIPE and MSG_SIGNAL
bug #57
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2013-03-12 21:13:47 +11:00
Angus Salkeld
75a550d8d3 IPC: fix call to QB_SUN_LEN
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2013-03-12 20:45:47 +11:00
Angus Salkeld
2125310c93 rpl_sem: make destroy more compliant
don't block completely on the sem_wait(), but chop the waits
into 1 sec blocks so the destroy can have an opertunity to complete.

fixes bug #55

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2013-02-19 12:40:06 +11:00
Angus Salkeld
6ba054713e RB: make the "sem" abstraction into a notifier
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2013-02-18 23:25:10 +11:00
Angus Salkeld
59243fb68c IPC: clean up the connection state checking
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2013-02-18 23:02:30 +11:00
Angus Salkeld
31d9f0900d Use dgram sockets for message oriented communications
This is to prevent partial sends and gettting stuck in
retry loops.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2013-02-18 20:51:33 +11:00
Angus Salkeld
481bd0cf86 IPC: don't interpret EMSGSIZE and ENOMSG as a disconnect
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2013-02-18 20:51:33 +11:00
Angus Salkeld
3d7774816e POLL: prevent a spin if the fd is not removed from the mainloop
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2013-02-18 20:51:33 +11:00
Angus Salkeld
9d2eca251b IPC: seperate ipc_us.c into 2 files
Seperate into a setup file and a socket backend file, it was getting messy
and confusing. Also preparing for using DGRAM sockets.

This should not result in any logical changes.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2013-02-06 11:21:05 +11:00
Angus Salkeld
aa43bb94d1 IPC: move utility functions to unix.c
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2013-02-06 11:08:38 +11:00
Angus Salkeld
dde6a46a83 IPC: make sure we return a consistent error when the message is too big.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2013-01-25 11:20:19 +11:00
The Quarterback Library Release Team
848242a786 Bump the version to 0.14.4
Signed-off-by: The Quarterback Library Release Team <quarterback-devel@fedorahosted.org>
2013-01-17 14:06:48 +11:00
Angus Salkeld
45f181125c LOG: prevent the last char of the blackbox message from getting lost.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2013-01-17 13:55:48 +11:00
Takeshi MIZUTA
37a6e7a5f1 Add the processing which remove notifier at skiplist_destroy function 2013-01-15 01:57:29 +09:00
Takeshi MIZUTA
c684cdb55e Add the processing which remove hash node and notifier at hashtable_destroy function 2013-01-14 03:39:47 +09:00
Takeshi MIZUTA
4d1a98ad76 Unify to QB_TRUE/QB_FALSE a boolean value 2013-01-11 02:01:06 +09:00
Takeshi MIZUTA
96e504f305 Unify the list processing with qb_list function 2013-01-09 02:04:20 +09:00
miz-take
d365310882 Fix return code which is an error occurred at pthread function 2013-01-06 03:08:33 +09:00
Angus Salkeld
739faa54fe LOG: fix truncation in some messages that get padded.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2013-01-04 15:55:19 +11:00
Angus Salkeld
e07eccd6a6 Fix the blackbox formatter when specifing the string len/precision
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-12-19 10:51:54 +11:00
Angus Salkeld
aed8fe942e Fix strlcpy and strlcat functions
These were not behaving as the man pages described.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-12-19 10:42:08 +11:00
Angus Salkeld
fe45c27ea6 IPC: don't over log on disconnect
Thanks grueni: https://github.com/asalkeld/libqb/pull/43

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-12-10 10:46:01 +11:00
Angus Salkeld
c69713e5f9 Make sure we don't use the format string whilst it is getting changed.
Just add a rwlock around the usage.
Move qb_log_format_set() to log_format.c to make this easier.

Fixes #45

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-12-10 10:32:31 +11:00
Angus Salkeld
813dfb5fd2 ptrie: deref the current node in trie_iter_free()
If free'ing the iterator before getting to the last
node make sure we de-ref the current node. Else we
will not be able to delete the node.

fixes #44

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-12-06 11:59:33 +11:00
Angus Salkeld
30a7871646 LOG: fix the format comparison to avoid generating multiple entries.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-11-29 17:31:05 +11:00
Angus Salkeld
a5795f7d45 LOG: set the return code when calloc fails
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-11-23 10:24:56 +11:00
Angus Salkeld
709b32de43 IPC: call poll if we are mid message and get EAGAIN
So just manually call us_ready (poll) with a timeout of 50ms
to prevent cpu spin.

Also update qb_ipc_us_recv() to be simerlar.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-11-12 19:38:20 +11:00
Angus Salkeld
14f0250a89 Remove extra ";"
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-11-09 10:28:29 +11:00
Angus Salkeld
b535ef241b IPC: set the error more correctly when qb_sys_mmap_file_open() fails.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-11-09 10:28:06 +11:00
Angus Salkeld
839d14f0ec Make sure that mmap'ed files smaller than a page size are written to.
This is a test to make sure that there is actually enough memory
to back the requested shared memory.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-11-09 10:15:25 +11:00
The Quarterback Library Release Team
92ada8c4d1 Bump the library version.
Signed-off-by: The Quarterback Library Release Team <quarterback-devel@fedorahosted.org>
2012-10-29 10:02:04 +11:00
Andrew Beekhof
e771439c1c IPC: Pass the timeout to poll() if the recv function returns EAGAIN 2012-10-23 11:14:59 +11:00
Angus Salkeld
6e130725e4 LOG: make the format comparison safe and sane
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-10-23 10:35:05 +11:00
Angus Salkeld
a623af9696 LOG: don't break on empty callsites, just ignore them
else we might miss some callsites.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-10-23 10:34:23 +11:00
Angus Salkeld
435d1dbce2 LOG: use the array callback to register new callsites
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-10-23 10:33:00 +11:00
Angus Salkeld
5e955579cb array: add a mechanism to get a callback when a bin is allocated
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-10-23 10:31:47 +11:00
Angus Salkeld
79059bcae3 Solaris based operating systems don't define MSG_NOSIGNAL and SO_NOSIGPIPE.
They return SIGPIPE when send is used with a closed socket. A SIGPIPE handler
must be used or SIGPIPE should be set ignored with SIG_IGN. In this case send
returns -1 instead of a SIGPIPE. The setting to ignore SIGPIPE is global and
should be used only where it is absolutely necessary.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-10-22 11:15:05 +11:00
Angus Salkeld
bcba4a2983 Fix a crash in ptrie if you iterate over the map in the deleted notifier.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-09-12 10:39:17 +10:00
Angus Salkeld
aedcb97690 Make sure atomic's are initialized (for non-gcc atomic).
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-09-11 14:42:04 +10:00
The Quarterback Library Release Team
74b7c6e990 Bump the version to 0.14.2
Signed-off-by: The Quarterback Library Release Team <quarterback-devel@fedorahosted.org>
2012-09-10 10:58:14 +10:00
Виноградов Василий
f44efc4529 Get libqb building on cygwin.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-09-07 09:14:07 +10:00
Jeremy Fitzhardinge
20a7075862 ipc_us: slightly more robust cmsg handling
Cope with multiple cmsg structures in the received msg.
2012-09-05 17:57:23 -07:00
Jeremy Fitzhardinge
6d75ccba6f ipc_us: on Linux, set SO_PASSCRED on the sending socket too
Linux doesn't pass credential information by default, only when it has
been specifically requested with SO_PASSCRED.  This means there's a
race between when the ipc server side has set up and is listening on the
socket, and when the client may connect; if the client connects and sends
its first message before the server has set SO_PASSCRED on the socket,
then there will be no ucred information associated with the message.

The fix is to set SO_PASSCRED on the client socket as well, so that
the message will always have a ucred associated with it when the server
reads it.

Without this change, around 1% of cpg_model_initialize() calls fail
with CS_ERR_ACCESS.

(This Linux behaviour was introduced just on a year ago in
16e5726269611b71c930054ffe9b858c1cea88eb "af_unix: dont send
SCM_CREDENTIALS by default".)
2012-09-05 17:51:49 -07:00
Jeremy Fitzhardinge
b79f8ceb1e ipc_us: clear request unused fields
Clear unused request fields and padding so that valgrind doesn't complain
about undefined data being sent over the socket.
2012-09-05 17:01:55 -07:00
Angus Salkeld
9d33e1f40d LOG: fix qb_vsnprintf_deserialize()
the strlcat was not call correctly, it needs the
original string to find the end and return the
correct length.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-09-05 18:35:19 +10:00
Jeremy Fitzhardinge
30139366ed blackbox: fix 64-bit big-endian issues
Two issues:
1. when writing out the function name length, don't just write the 4 MSB
   of the size
2. when reading the time, don't just use the 4 MSB of the time as the
   timestamp; the log contains a full time_t, so we may as well use it.
2012-08-31 13:21:00 -07:00
Angus Salkeld
c7810b38b1 Remove IPC_NEEDS_RESPONSE_ACK and turn off shm ipc on solaris
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-08-31 14:53:38 +10:00
Angus Salkeld
ffcb11f93d Some improvements to kqueue usage.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-08-31 13:32:11 +10:00
Angus Salkeld
b6e0b5b431 kqueue: drop log message to trace.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-08-30 23:12:36 +10:00
Angus Salkeld
988c1e259c Fix splint warning
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-08-29 23:29:05 +10:00
Angus Salkeld
cceb4e2e5f Avoid strcpy() use strlcpy() instead.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-08-29 22:31:57 +10:00
Angus Salkeld
95840eb3aa Fix kqueue complile warnings
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-08-29 22:31:29 +10:00
Angus Salkeld
d92bfa2b0e openbsd doesn't have EBADMSG
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-08-29 22:30:58 +10:00
Angus Salkeld
a55554efb1 LOG: change qb_vsprintf_serialize() into qb_vsnprintf_serialize()
This is to prevent overwriting the ringbuffer.
Also remove stpcpy() as it is not used anymore.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-08-29 21:40:40 +10:00
Angus Salkeld
10045dd561 Some missing pshared semaphore checks
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-08-29 12:26:47 +10:00
Angus Salkeld
873e467cf8 Cleanup the checks for pshared semaphores
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-08-29 10:22:56 +10:00
Angus Salkeld
fb76492880 RB: change the #error to ENOTSUP if no usable shared process sem
This is mainly on mac.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-08-28 21:30:43 +10:00
Angus Salkeld
b6839bacfe LOOP-KQUEUE: fix reference before assignment.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-08-28 14:39:28 +10:00
Fabio M. Di Nitto
5e16bcd004 build: fix libqb.pc creation and make maintainer-clean
LIB_RT is unnecessary around. AC_CHECK_LIBS will do the right thing

similar for the other libs that are all exported via LIBS

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
2012-08-27 15:07:36 +02:00
Angus Salkeld
248259f12b LOG: Make sure the semaphores are initialized.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-08-27 19:16:04 +10:00
Angus Salkeld
50632154ed Catch disconnected sockets on Solaris
It seems like poll() was not producing a POLLHUP
so we rely on qb_ipc_us_recv() returning -ENOTCONN.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-08-24 11:49:07 +10:00
Jeremy Fitzhardinge
4a1e24ee3e Don't free rb->shared_hdr in qb_rb_create_from_file()
Since qb_rb_close() frees it by munmapping it.
2012-08-23 10:14:11 -07:00
Jeremy Fitzhardinge
069f4e3190 Check error return of qb_ipcs_uc_recv_and_auth()
If it fails, then &ugp isn't initialized.
2012-08-23 10:12:09 -07:00
Angus Salkeld
70c8df9a19 Work around debian not setting the arch path in splint.
So just adding both i386 and x86_64 to the path.
Ref: http://lists.gnu.org/archive/html/gpsd-dev/2012-05/msg00221.html

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-08-22 10:58:29 +10:00
David Vossel
d5b762e441 LOG: Invoke custom log filter function if tag changes 2012-07-19 17:18:46 -05:00
Jim Meyering
c60f5012ea ipcs: avoid use-after-free for size-0 || disconnect-request
Hi,

Glancing through coverity-reported issues,
I saw that this one required attention:

From 70f1f689022321710405f16dc45b3df30c22bc59 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Wed, 18 Jul 2012 17:34:17 +0200
Subject: [PATCH] ipcs: avoid use-after-free for size-0 || disconnect-request

spotted by coverity:
http://libqb.org/html/0.14.1/coverity/1/265ipcs.c.html#error

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-07-19 08:19:22 +10:00
The Quarterback Library Release Team
5470bf5625 Bump the version to 0.14.1
Signed-off-by: The Quarterback Library Release Team <quarterback-devel@fedorahosted.org>
2012-07-17 22:03:31 +10:00
Angus Salkeld
e5be0396a7 RB: set the new read pointer after clearing the header.
This is to prevent a situation where a fast writer will
write their new chunk between setting the new read pointer
and clearing the header.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-07-17 21:18:47 +10:00
Angus Salkeld
3feb3b6b8f RB: improve the debug print outs
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-07-17 20:45:29 +10:00
Angus Salkeld
b9a992a5d3 RB: be more explicit about the word alignment
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-07-17 19:37:52 +10:00
Angus Salkeld
15d0291a8a RB: cleanup the macros for wrapping the index
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-07-17 12:38:22 +10:00
Angus Salkeld
6e1d9054c3 RB: use sem_getvalue as a tie breaker when read_pt == write_pt
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-07-17 12:38:22 +10:00
Angus Salkeld
bdc63cdf1a RB: if read or peek don't get the message then re-post to the semaphore
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-07-17 12:38:22 +10:00
Angus Salkeld
deddaea86c RB: convert the rb_peek() status into a recv like status.
peek returns 0 on no data, so convert that to -EAGAIN.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-07-17 12:22:31 +10:00
Angus Salkeld
121abe3dbe RB: use internal reclaim function
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-07-17 12:22:26 +10:00
Angus Salkeld
3b31023d84 IPC: use calloc instead of malloc to fix valgrind warnings
This is to cleanup some valgrind warnings.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-07-17 12:22:17 +10:00
Angus Salkeld
740f9df7ac Fix a valgrind error.
just use the receive buffer, as it will be big enough.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-07-14 22:29:25 +10:00
The Quarterback Library Release Team
1c2b77f005 Bump the version to 0.14.0
Signed-off-by: The Quarterback Library Release Team <quarterback-devel@fedorahosted.org>
2012-06-22 16:29:32 +10:00
Angus Salkeld
b9f8ec34df LOG: fix threaded logging.
This has been broken for a year - yikes!
Thanks to Voznesensky Vladimir for spotting it.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-06-14 11:01:52 +10:00
Angus Salkeld
22569f51ba Add user control of the permissions that are set on the shared mem files
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-06-13 08:21:09 +10:00
Andrew Beekhof
e70e7908f0 LOG: Restrict string trucation during serialization to when a precision is specified 2012-06-07 15:02:06 +10:00
Andrew Beekhof
bb2e307241 LOG: Gracefully fail when the caller exceeds QB_LOG_MAX_LEN 2012-06-07 14:41:03 +10:00
Andrew Beekhof
9b0bb4e80e LOG: Observe field widths when serializing string arguments 2012-06-07 14:40:34 +10:00
Angus Salkeld
3369581066 RB: use the same mechanism in reclaim as read/peek to detect end-of-ring
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-06-07 12:02:32 +10:00
Angus Salkeld
9520fc4501 RB: fix wrong sem_flg IPC_NOWAIT option
The #ifdef was the wrong way around causing
the sem to return early with EAGAIN.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-06-06 16:22:58 +10:00
Angus Salkeld
194b93678f Open shared mem file in /dev/shm only for linux
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-06-06 15:31:51 +10:00
Angus Salkeld
c0f52fb5c2 Don't use msg_flags on solaris (recvmsg).
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-06-06 15:29:10 +10:00
Angus Salkeld
73731f0643 IPC: if the server returns EAGAIN or ETIMEOUT the check the connection
Mainly useful for shm, as the ringbuffer doesn't know the state
of the connection.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-06-06 13:46:58 +10:00
Angus Salkeld
b52f2e37b3 LOG: make it possible to fsync() on each file log.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-06-05 12:07:35 +10:00
Angus Salkeld
460cc70a8b IPC: make sure that the created callback happens before dispatches
This only happened on the socket ipc type.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-06-04 21:45:28 +10:00
Angus Salkeld
9956fe29ff LOG: fix the printing of %p in the blackbox
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-06-04 14:54:39 +10:00
Angus Salkeld
1e81530332 IPC: On bsd's use the notifier for responses
The point of this is to catch connection failures
more reliably.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-06-01 11:12:44 +10:00
Angus Salkeld
44f61b23bb IPC: interpret ECONNRESET and EPIPE as ENOTCONN
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-06-01 10:15:36 +10:00
Angus Salkeld
35a4421d23 cleanup some warnings
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-31 22:18:04 +10:00
Angus Salkeld
9f90b16d06 blackbox: fix %p formatting
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-28 23:16:49 +10:00
Angus Salkeld
d280ddd6e4 LOG: put all fields in the blackbox (added priority and tags)
Fixes #36

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-28 22:23:22 +10:00
Angus Salkeld
85b39906a9 RB: fix compiler warning.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-28 19:10:13 +10:00
Angus Salkeld
4208a4b88b Add replacement function stpcpy
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-28 19:10:13 +10:00
Angus Salkeld
fe8014b379 Use AC_FUNC_STRERROR_R and STRERROR_R_CHAR_P
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-28 14:41:43 +10:00
Angus Salkeld
2b49dc7030 Move some conditional defines into code (from the configure script)
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-28 14:33:03 +10:00
Angus Salkeld
70a9623a48 Remove message queues
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-28 13:41:04 +10:00
Angus Salkeld
aaae0a3c31 Check for union semun properly
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-28 13:35:48 +10:00
Angus Salkeld
531f7cdb7a Blackbox: provide more space for log messages when reading from the blackbox.
This is to allow for the header (16bytes and variable length function).
so if someone has a function name > 400 chars it will break. I
recon that will do:)

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-28 13:34:15 +10:00
Andrew Beekhof
77fa3650dd RB: Read the file size into an initialized variable of the correct size 2012-05-28 12:25:10 +10:00
Angus Salkeld
e0bc3a15ce RB: to be safer save the read and write pointers at the top of the blackbox
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-25 14:01:19 +10:00
Jim Meyering
32abe38ffd avoid unwarranted use of strncpy: use memcpy instead
* lib/log_format.c (qb_vsnprintf_deserialize): We know that there are
len or more non-NUL bytes in the source string, so it's clearer to
use memcpy.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-24 20:47:57 +10:00
Angus Salkeld
a8405ab06d blackbox: fix the print_from_file()
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-24 19:22:55 +10:00
Angus Salkeld
4fdabe5bed RB: add an option to not use any semaphores
(brought over from the "speed" branch)

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-24 19:16:59 +10:00
Angus Salkeld
0327b6aa86 LOG: tweak the blackbox format string
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-24 14:37:05 +10:00
Angus Salkeld
c56427e19e LOG: accept NULL strings into the blackbox
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-24 14:16:54 +10:00
Angus Salkeld
072e224331 LOG: protect close and reload from calling log
Logging during these operations is temporarly disabled.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-24 13:06:51 +10:00
Angus Salkeld
0458c5ccd2 IPC: log the connection description in all logs
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-16 13:59:12 +10:00
Angus Salkeld
78374c2ed3 IPC: only modify the dispatch if we get EAGAIN
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-16 13:19:41 +10:00
Jan Friesse
a4411105a7 Correctly display timestamp in blackbox
On little endian architectures where time_t is 64-bit long integer could
happen, that instead of displaying correct timestamp, random data was
used, because of memcpy.

Solution is to memcpy to real 32-bit variable and then assing this value
to timestamp. This will let compiler decide endianity and store number
correctly.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-12 22:04:59 +10:00
Angus Salkeld
955d43eae6 Add a more verbose version of the library versioning text.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-10 20:45:13 +10:00
Angus Salkeld
b3aa86dc42 Bump the library version to 0.13.0
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-10 20:44:10 +10:00
Angus Salkeld
6d2137fd8d Remove unneccessary __attribute__ ((aligned(8))) from internal headers
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-10 20:31:15 +10:00
Angus Salkeld
908bdfd172 IPC: add a new function to get (and alloc) the extended stats.
This should handle any further additions to the stats
as the library allocs the struct.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-10 20:20:29 +10:00
Angus Salkeld
c221922291 Revert "Add the event queue length to the connection stats."
This reverts commit 6b7da3f531.
2012-05-10 16:09:48 +10:00
Angus Salkeld
cf93d256ca IPC: cleanup better on a failed client connect.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-10 14:22:31 +10:00
Angus Salkeld
e6536b222b IPC(soc): be more consistent with control struct size
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-10 14:13:52 +10:00
Angus Salkeld
cbb6495454 IPC: kill a compiler warning
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-10 13:38:32 +10:00
Angus Salkeld
1d7a716849 IPC(soc): pass in the correct size into munmap()
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-10 13:38:02 +10:00
The Quarterback Library Release Team
0b8aeb66c8 Bump the lib version to 0.12.0
Signed-off-by: The Quarterback Library Release Team <quarterback-devel@fedorahosted.org>
2012-05-10 11:48:46 +10:00
Angus Salkeld
c566421df9 rb: cleanup the semaphores
- the way they are selected
- rpl_sem.c the error handling

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-10 10:39:43 +10:00
Angus Salkeld
8ed5f55990 Cleanup the .gitignore files
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-09 21:43:58 +10:00
Angus Salkeld
916440d08d Remove HZ and use sysconf instead.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-09 21:38:38 +10:00
Angus Salkeld
259021414a SUN_LEN() macro is present if __EXTENSIONS__ is defined on Illumos
A bit reworked but originally from Igor Pashev:
84c47f8160

Note: __EXTENSIONS__ also defines _GNU_SOURCE, so removing it as well.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-09 21:37:04 +10:00
Igor Pashev
9b3822dd2a PF_UNIX is a POSIX standard name 2012-05-09 18:56:25 +10:00
Igor Pashev
62e070a720 Test for log facility names 2012-05-09 18:56:08 +10:00
Angus Salkeld
b6945e5eb6 IPC: drop log message to debug.
this can be noisy when there are a lot of transient
connections.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-09 11:45:51 +10:00
Angus Salkeld
7c2e632be0 IPC: fix retrying of partial recv's and sends.
Move to send() instead of sendmsg() as it's easier
to track resending partial messages.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-03 21:24:02 +10:00
Angus Salkeld
c2651bb9bf IPC: initialize enough shared mem for all 3 one way connections.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-03 08:20:59 +10:00
Angus Salkeld
494293a97b IPC: keep retrying to recv the socket message if partially recv'ed (part 2)
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-02 16:39:03 +10:00
Angus Salkeld
f2916c7576 IPC: keep retrying to recv the socket message if partially recv'ed
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-02 16:03:23 +10:00
Angus Salkeld
72938081c0 IPC: handle the server shutdown better
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-02 16:00:05 +10:00
Angus Salkeld
9f09aba8dd IPC: handle a connection disconnect from the server better
Only problem with SOCKET.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-02 10:15:19 +10:00
Angus Salkeld
78fb4ad682 IPC: make it possible to send events in the connected callback.
This was only a problem with QB_IPC_SOCKET.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-01 20:09:21 +10:00
Angus Salkeld
6b7da3f531 Add the event queue length to the connection stats.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-01 13:22:16 +10:00
Angus Salkeld
b29326a363 IPC: add a is_connected client side function.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-01 12:43:22 +10:00
Angus Salkeld
4550cc9e45 Remove unused local variable
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-05-01 09:13:04 +10:00
Angus Salkeld
9e3c2ea33d IPC: change the socket recv function to read the response header.
It needs to only recv the size of this message, else we recv more
than one message and effectively drop messages (hidden at the end
of the current message).

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-04-30 15:49:42 +10:00
Angus Salkeld
3f4a175312 IPC: make it possible for a root client to talk to a non-root server.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-04-30 08:25:57 +10:00
Angus Salkeld
fbd05ba1d2 IPC: make sure ipc (socket) clients can connect to a server running as root.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-04-26 21:35:38 +10:00
Angus Salkeld
0e140bbf0f IPC: allow qb to bump the max_message_size
I think this is more user friendly.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-04-23 20:42:45 +10:00
Angus Salkeld
72033f2b4f IPC: check for a sane minimum max_message_size
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-04-23 19:57:26 +10:00
Angus Salkeld
316fd95e00 add rpl_sem.h loop_poll_int.h to noinst_headers
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-04-23 19:10:43 +10:00
Angus Salkeld
239ddc067f Handle errors more consistently
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-04-04 21:57:49 +10:00
Angus Salkeld
b650bf29d6 call recv_ready on socket types
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-04-04 21:57:49 +10:00
Angus Salkeld
d80f218133 Handle a recv of size 0
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-04-04 21:57:49 +10:00
Angus Salkeld
4b7581e514 make bsd shm path better by default.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-04-04 20:55:37 +10:00
Angus Salkeld
481b354794 Fix kqueue on freebsd.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-04-04 20:55:37 +10:00
Angus Salkeld
7a09cdae67 Fix kqueue compiling.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-04-04 01:37:00 +10:00
Angus Salkeld
26491555ef POLL: seperate out the poll/epoll and add kqueue
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-04-04 00:26:20 +10:00
Jan Friesse
e2fe03e491 Don't link with setpshared if unavailable
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-04-03 21:23:18 +10:00
Jan Friesse
7b13d09afb Use MADV_NOSYNC only on systems where available
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-03-28 09:28:42 +11:00
Jan Friesse
77787d49e5 Use SCHED_BATCH only on platforms where available
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-03-28 09:28:42 +11:00
Angus Salkeld
c97113bd83 Fix a bug introduced by the bsd patch.
I missed the non-native case.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-03-27 20:57:10 +11:00
Angus Salkeld
3d291540b1 Cleanup the selection of semaphores to use
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-03-27 20:57:06 +11:00
Angus Salkeld
d6883981e3 Fix some leaks in the logging.
Mainly for valgrind purposes.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-03-27 16:42:38 +11:00
Angus Salkeld
1af214d91d Try and improve the portability on bsd variants.
Also add a QB_IPC_NATIVE type that selects the best ipc type available.

Signed-off-by: Angus <angus@anguss-mac-mini>
2012-03-24 22:43:37 +11:00
The Quarterback Library Release Team
50f07abcfe Bump the version to 0.11.1
Signed-off-by: The Quarterback Library Release Team <quarterback-devel@fedorahosted.org>
2012-03-11 22:17:43 +11:00
Angus Salkeld
4f5d55a48e LOOP: remove some old timerfd code.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-03-09 20:20:04 +11:00
Angus Salkeld
082a04e288 LOOP: when new jobs are added they are added to the head instead of the tail.
We must add new jobs to the tail of the job queue otherwise
old jobs will get stuck in the job list.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-03-09 19:32:37 +11:00
Angus Salkeld
9294ebfa57 LOG: Now the array is self locking we can make the lookup array dynamic
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-03-09 12:34:50 +11:00
Angus Salkeld
4df255d919 Add locking to the array when growing.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-03-09 12:34:50 +11:00
Angus Salkeld
58bc8e6bb4 IPC: make the _request_q_len_get() function more obvious.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-03-09 12:34:50 +11:00
Angus Salkeld
bd39cd4d20 IPC: fix multiple receives from qb_ipc_us_recv()
So this function is used by the QB_IPC_SOCKET transport
and is used like recv(,, max_size_of_my_rx_buf,,);
But in the shared mem transport it is used to recv
a notification of something in shared mem is available
in this case we really want to make sure we recv all
the notifications. So I have split these into 2 functions.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-03-09 12:21:38 +11:00
Angus Salkeld
c2f5f94312 IPC: make sure that the wrong union member is not written to.
Move the connection type into the one_way struct. Seem
like a more obvious place for it next to the union.

Also it will help prevent issues like in qb_ipc_us_recv()
where there is a rather dodgy access of ctl->sent.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-03-09 12:18:02 +11:00
Angus Salkeld
6d0d8bb670 TIMER: check for null timer handle
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-03-09 12:17:03 +11:00
The Quarterback Library Release Team
418471e6c1 Bump the version to 0.11.0
Signed-off-by: The Quarterback Library Release Team <quarterback-devel@fedorahosted.org>
2012-03-07 21:11:40 +11:00
Angus Salkeld
a9cdbbef8e ARRAY: cleanup the pointer sizeof()
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-03-07 20:42:51 +11:00
Angus Salkeld
430c038d36 LOG: make the log arrays manually grow-able since we need to lock the calls.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-03-07 12:48:43 +11:00
Angus Salkeld
2ae58d2472 RB: fix test failure on ppc
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-03-07 11:37:12 +11:00
Angus Salkeld
9027c3531b RB: change the name of the size to word_size to be more clear
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-03-07 10:34:19 +11:00
Angus Salkeld
98e97129d8 LOOP: fix deletion of signal handlers when they are pending
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-03-06 22:28:09 +11:00
Angus Salkeld
ab5da6ff1f LOOP: signal handlers were always added as high priority.
This now adds them as requested by the user.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-03-06 22:01:12 +11:00
Angus Salkeld
d327ef7928 LOG: expose the mechanism to get a dynamic callsite.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-03-05 16:11:30 +11:00
Angus Salkeld
7a59f73d53 Revert part of my COARSE grained timer commit
The stopwatch and timers use qb_util_nano_current_get()
and need to be accurate. This does't seem to effect
performance at all so no loss there.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-02-24 12:29:57 +11:00
Angus Salkeld
002f009941 Remove timerfd usage and go back to timelist.
timefd is using too much cpu and it is using up
file descriptors.

timelist is also more portable and now I have less
code to maintain.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-02-24 11:40:45 +11:00
Angus Salkeld
4356fbf577 UTIL: if possible use COARSE resolution clocks - they are much faster.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-02-24 11:25:55 +11:00
Angus Salkeld
0d21be245b ARRAY: save memory (in the bins array) and allow holes in the array
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-02-22 17:30:19 +11:00
Angus Salkeld
e37f801170 LOOP: add qb_loop_timer_is_running()
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-02-22 11:08:42 +11:00
Angus Salkeld
1d857f5b51 LOOP: allow stop() and run() to be called with NULL loop instance.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-02-20 14:46:43 +11:00
Angus Salkeld
4dbfebbdbc LOG: add stdout target
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-02-20 14:46:43 +11:00
Angus Salkeld
70f1eb8130 LOOP: add a function to delete jobs
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-02-15 22:18:43 +11:00
Angus Salkeld
b298e01abc LOG: remove debug printf's
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-02-15 17:38:59 +11:00
Angus Salkeld
504e000cb8 LOG: add a hostname %H format specifier.
This is useful when logging to file on a cluster.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-02-15 17:34:45 +11:00
Angus Salkeld
ff0d89721f LOG: Add qb_log_filter_fn_set()
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-02-15 15:40:58 +11:00
The Quarterback Library Release Team
1c8a9d6461 Fix "make distcheck" add include path to AM_CPPFLAGS
strl* files are built a bit differently and need the global
flags

Signed-off-by: The Quarterback Library Release Team <quarterback-devel@fedorahosted.org>
2012-02-14 21:48:53 +11:00
The Quarterback Library Release Team
b2c9cb6cb3 Bump the version to 0.10.1
Signed-off-by: The Quarterback Library Release Team <quarterback-devel@fedorahosted.org>
2012-02-14 21:33:21 +11:00
Angus Salkeld
42de03038e clang: Remove unused code
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-02-14 17:27:26 +11:00
Angus Salkeld
2a0cdd8f5f RB: add a debug message if trying to read a message of the wrong size
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-02-14 16:43:50 +11:00
Angus Salkeld
d633b4e2fa IPC: split up the recv into chuncks of 2 seconds.
This is because semaphores can't detect the other side has
failed/exited. So we rely on the socket poll to tell us.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-02-14 16:42:59 +11:00
Angus Salkeld
b5c66cab7c Be more consistent with the internal logs.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-02-14 12:43:42 +11:00
Angus Salkeld
1e4b33c9cf LOOP: make it possible to pass in NULL as the default loop instance
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-02-10 14:47:49 +11:00
Angus Salkeld
2b2dfd5d2c RB: use the proper struct not the typedef in the implementation.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-02-08 22:00:50 +11:00
Angus Salkeld
dff3ff4afe RB: Fix potential mem leak
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-02-08 22:00:50 +11:00
Angus Salkeld
205336980c use random() not rand()
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-02-08 22:00:49 +11:00
Angus Salkeld
943e6b301d Remove dead code
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-02-08 22:00:49 +11:00