Michal Sojka [Thu, 24 Feb 2011 15:24:16 +0000 (16:24 +0100)]
forb: Add forb_executor_synchronize()
This is used to wait for executors to finish processing ongoing requests
during FORB termination. This ensures that all peer sockets are closed
and wvtest does not complain about open file descriptors at the end of
tests.
Michal Sojka [Sun, 20 Feb 2011 09:42:58 +0000 (10:42 +0100)]
forb: Fix synchronization error in forbrun
forbrun starts servers synchronously, i.e. the next server is started
only after the previous one is fully initialized (see
forb_signal_server_ready()). This synchronization was broken because
forb_signal_server_ready() was incorrectly called in
forb_execute_object() called from forb_execution_thread() called from
forb_init(). This caused that the semaphore for the synchronization had
the value of one (instead of zero) when forb_init() finished.
Therefore, the first waiting for the semaphore returned immediately
without actually waiting for the server.
This is now fixed by introduction of default_executor which is declared
in struct forb. This executor is initialized "manually", without
forb_execute_object(), so that the forb_signal_server_ready() is not
called.
In future, we might want use the default executor for executing requests
to other objects, which do not require a separate thread.
Michal Sojka [Sat, 19 Feb 2011 22:57:48 +0000 (23:57 +0100)]
forb: Fix deadlock in executor
The first iteration of executor loop waited for the request without
actually checking that there is no request in the queue. Therefore,
when the client sent the request before the executor called
fosa_cond_wait() for the first time, the executor blocked indefinitely.
Michal Sojka [Sat, 19 Feb 2011 13:42:16 +0000 (14:42 +0100)]
forb: Do not compile inet_broadcast if it is not used
When inet is the default protocol, broadcasts are not used (because they
are not reliable). Previously, if inet was the default, we didn't bind the
socket to multicast address and thus we were not able to receive the
broadcasts. This situation was confusing and therefore it is better omit
the implementation of inet_broadcast entirely to make this clear that it
is not used.
Michal Sojka [Fri, 18 Feb 2011 23:42:20 +0000 (00:42 +0100)]
forbrun: Enable uLUt-based logging
It had no sense to disable it -- it works fine for FORB logging. If it
is needed to change log levels of server, this could be implemented in
forb_main() of the particular server.
Michal Sojka [Fri, 18 Feb 2011 23:19:46 +0000 (00:19 +0100)]
forbrun: Comment out not passing test
This test does not pass because the registered references are not
distributed to other servers. This will be hopefully implemented later
through some kind of name server.
Michal Sojka [Tue, 15 Feb 2011 16:12:15 +0000 (17:12 +0100)]
forb: First implementation of forbrun
Not tested! forbrun should executed FORB servers implemented as shared
libraries. Its aim is to allow execution of multiple independent servers
in a single process. This is done in preparation of porting FRSH/FORB to
RTEMS (and other single-address space executives).
Michal Sojka [Tue, 8 Feb 2011 17:01:37 +0000 (18:01 +0100)]
forb: Add test for various invocation methods
This tests the following:
1) remote invocation (currently broken)
2) local invocation from application to the executor
3) local invocation from an executor to another one
4) direct invocation from an executor to the same one
Michal Sojka [Fri, 28 Jan 2011 16:04:37 +0000 (17:04 +0100)]
Initialize thread specific data in forb_init()
This was done to avoid race conditions which causes errors in code.
Unfortunately this change does not help since FOSA is broken and we will
better use plain POSIX here.
Michal Sojka [Thu, 24 Jun 2010 22:38:26 +0000 (00:38 +0200)]
Get compilable output for sequences of a typedeffed type
This change is a workaround rather than a real fix. This way be generate
unnecessarily more [de]serialization functions even if they do the same
as the function of the original type.
Michal Sojka [Fri, 18 Jun 2010 14:08:38 +0000 (16:08 +0200)]
Do not destroy forb automatically on exit
I do not know how to deregister the exit handler which is needed if
forb_destroy() is called manually. If the handler is not deregister
we get double free error.
Michal Sojka [Thu, 28 May 2009 03:29:59 +0000 (05:29 +0200)]
Added redistribution of HELLO packets
In FRSH_FORB, contract broker acts as central node and redistributes
HELLO packets to all connected applications. This way every application
can connect to every other.
Michal Sojka [Wed, 27 May 2009 21:34:29 +0000 (23:34 +0200)]
Inet protocol sends HELLO as the first message after connect()
This allows the receiver to know sender's listening address, which is different
from the address of the connect()ed socket. Besides the address, also orb_id is
sent, which makes debugging easier.
It this approach is found successful, this functionality should be moved to
iop.c and protocols should have new connect callback which will be called by iop
if the peer was never contacted.
Michal Sojka [Wed, 27 May 2009 18:33:14 +0000 (20:33 +0200)]
Correct handling of closed TCP connections in proto_inet
In FRSH_FORB this allows restarting resource managers without restart of fcb.
The problem of previous implementation was, that if the socket was closed but
peer structure was not unregistered the disconnected peer structure stored
fd of closed socket and when a new connection was made, the fd was the same
as stored in disconnected peer structure. Therefore the disconnected peer
appeared as alive.
Michal Sojka [Wed, 27 May 2009 18:32:15 +0000 (20:32 +0200)]
Discovery handling moved to discovery.c
This was done to defined better (more higher level) interface to peer
manipulation. The interface is represented by forb_new_peer_discovered(),
forb_peer_disconnected() and forb_peer_find[_timer]().
Michal Sojka [Tue, 26 May 2009 15:03:27 +0000 (17:03 +0200)]
Automatically register FCB peer when INET is default
FCB is always found on a fixed port. If FCB_ADDR environment variable
it not set, it is registered on 127.0.0.1, otherwise it is registered
on address according to the FCB_ADDR.