[Vortex] restarting vortex issue

Martin Huter m.huter at phion.com
Tue Feb 6 11:38:09 CET 2007


hi,

i'm looking for a way to - somehow - restart vortex:
since there are no methods to 
1) remove profiles and
2) remove listeners, 
it is required to restart the application if the configuration in one of those 
two named cases above changes.

my first approach was to unlock the listeners, call vortex_exit() and restart 
with vortex_init(), etc.
that caused my application to crash. i've had a look to the library and fixed 
following two things:

************************************************
diff -Naur vortex-1.0.b2411.g2413.orig/src/vortex.c 
vortex-1.0.b2411.g2413/src/vortex.c
--- vortex-1.0.b2411.g2413.orig/src/vortex.c    2007-02-05 17:22:41.000000000 
+0100
+++ vortex-1.0.b2411.g2413/src/vortex.c 2007-02-05 17:23:06.000000000 +0100
@@ -426,6 +426,7 @@
        /* check if the library is already started */
        if (!already_started)
                return;
+       already_started=FALSE;

        vortex_log (LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "shutting down vortex 
library");

diff -Naur vortex-1.0.b2411.g2413.orig/src/vortex_profiles.c 
vortex-1.0.b2411.g2413/src/vortex_profiles.c
--- vortex-1.0.b2411.g2413.orig/src/vortex_profiles.c   2007-02-05 
17:22:41.000000000 +0100
+++ vortex-1.0.b2411.g2413/src/vortex_profiles.c        2007-02-06 
09:45:34.726721757 +0100
@@ -829,6 +829,7 @@
         * configuring __destroy_profile_item function at hash time
         * creation. */
        vortex_hash_destroy (registered_profiles);
+       registered_profiles=NULL;

        return;
 }
************************************************

thereafter, my application did not crash any more, but 
1) the threads were not terminated and
2) the listeners were not removed.

so i additionally called vortex_thread_pool_exit after() vortex_exit(). that 
caused all threads except one to be terminated. then i did not get on any 
further.

my second approach was to start vortex in a child process as shown in 
following example:


************************************************
void vortexttest()
{
    int pid=fork();

    if(pid){
        int status;

        printf("parent (%d), waiting\n", getpid());
        waitpid(pid, &status, 0);
    }
    else if(!pid){
        printf("init start\n");
        vortex_init();
        printf("init done\n");
        sleep(3);
        _exit(0);
    }
}
************************************************

surprisingly, the application hangs, that is vortex_init() does not return in 
that case!

is there a method to restart vortex?

cheers
martin huter

-- 
______________________________
Martin Huter
phion Information Technologies GmbH
Unit Manager
Eduard-Bodem-Gasse 1
A-6020 Innsbruck
tel: +43 512 394545 - 504
fax: +43 512 394545 - 20
web: www.phion.com
mail: m.huter at phion.com



More information about the Vortex mailing list