You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by "Ben Wyckoff (JIRA)" <ji...@apache.org> on 2008/02/20 07:44:43 UTC

[jira] Created: (AXIS2C-995) mod_axis2 fails to call svc_skeleton_free

mod_axis2 fails to call svc_skeleton_free
-----------------------------------------

                 Key: AXIS2C-995
                 URL: https://issues.apache.org/jira/browse/AXIS2C-995
             Project: Axis2-C
          Issue Type: Bug
          Components: core/transport
    Affects Versions: 1.2.0
         Environment: solaris 10 x86, apache 2.2.4
            Reporter: Ben Wyckoff


mod_axis2 calls AXIS2_SVC_SKELETON_INIT but never calls AXIS2_SVC_SKELETON_FREE (or the equivalent), which leaves resources allocated at init time dangling. The axis2_hhtp_server does properly call free, allowing the service to properly clean up after itself.

This issue was submitted to the axis2-c users list, and Dumindu Pallewela replied with the following patch.

Index: mod_axis2.c
===================================================================
--- mod_axis2.c	(revision 629362)
+++ mod_axis2.c	(working copy)
@@ -425,6 +425,19 @@
 #endif
 }
 
+typedef struct worker_cleanup_data
+{
+    const axutil_env_t * env;
+    axis2_apache2_worker_t * worker;
+} worker_cleanup_data_t;
+
+static apr_status_t worker_cleanup(void *data)
+{
+    worker_cleanup_data_t *d = (worker_cleanup_data_t *) data;
+    axis2_apache2_worker_free(d->worker, d->env);
+    return APR_SUCCESS;
+}
+
 static int axis2_post_config(apr_pool_t *pconf, apr_pool_t *plog,
 								 apr_pool_t *ptemp, server_rec *svr_rec)
 {
@@ -592,6 +605,14 @@
                      "[Axis2] Error creating mod_axis2 apache2 worker");
         exit(APEXIT_CHILDFATAL);
     }
+    else
+    {
+        worker_cleanup_data_t *data = apr_palloc(pconf, sizeof(worker_cleanup_data_t));
+        data->env = axutil_env;
+        data->worker = axis2_worker;
+        apr_pool_cleanup_register(pconf, data, worker_cleanup, apr_pool_cleanup_null);
+    }
+
 	return OK;
 }
 



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org


[jira] Commented: (AXIS2C-995) mod_axis2 fails to call svc_skeleton_free

Posted by "Supun Kamburugamuva (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2C-995?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12607207#action_12607207 ] 

Supun Kamburugamuva commented on AXIS2C-995:
--------------------------------------------

Hi Senaka,

If the memory is the only concern what you are saying is right. But what if a user creates a file handler or a database connection in the init method? Then that resouce won't get free. 

Supun.

> mod_axis2 fails to call svc_skeleton_free
> -----------------------------------------
>
>                 Key: AXIS2C-995
>                 URL: https://issues.apache.org/jira/browse/AXIS2C-995
>             Project: Axis2-C
>          Issue Type: Bug
>          Components: core/transport
>    Affects Versions: 1.2.0
>         Environment: solaris 10 x86, apache 2.2.4
>            Reporter: Ben Wyckoff
>
> mod_axis2 calls AXIS2_SVC_SKELETON_INIT but never calls AXIS2_SVC_SKELETON_FREE (or the equivalent), which leaves resources allocated at init time dangling. The axis2_hhtp_server does properly call free, allowing the service to properly clean up after itself.
> This issue was submitted to the axis2-c users list, and Dumindu Pallewela replied with the following patch.
> Index: mod_axis2.c
> ===================================================================
> --- mod_axis2.c	(revision 629362)
> +++ mod_axis2.c	(working copy)
> @@ -425,6 +425,19 @@
>  #endif
>  }
>  
> +typedef struct worker_cleanup_data
> +{
> +    const axutil_env_t * env;
> +    axis2_apache2_worker_t * worker;
> +} worker_cleanup_data_t;
> +
> +static apr_status_t worker_cleanup(void *data)
> +{
> +    worker_cleanup_data_t *d = (worker_cleanup_data_t *) data;
> +    axis2_apache2_worker_free(d->worker, d->env);
> +    return APR_SUCCESS;
> +}
> +
>  static int axis2_post_config(apr_pool_t *pconf, apr_pool_t *plog,
>  								 apr_pool_t *ptemp, server_rec *svr_rec)
>  {
> @@ -592,6 +605,14 @@
>                       "[Axis2] Error creating mod_axis2 apache2 worker");
>          exit(APEXIT_CHILDFATAL);
>      }
> +    else
> +    {
> +        worker_cleanup_data_t *data = apr_palloc(pconf, sizeof(worker_cleanup_data_t));
> +        data->env = axutil_env;
> +        data->worker = axis2_worker;
> +        apr_pool_cleanup_register(pconf, data, worker_cleanup, apr_pool_cleanup_null);
> +    }
> +
>  	return OK;
>  }
>  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org


[jira] Updated: (AXIS2C-995) mod_axis2 fails to call svc_skeleton_free

Posted by "S.Uthaiyashankar (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2C-995?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

S.Uthaiyashankar updated AXIS2C-995:
------------------------------------

    Fix Version/s: 1.6.0

> mod_axis2 fails to call svc_skeleton_free
> -----------------------------------------
>
>                 Key: AXIS2C-995
>                 URL: https://issues.apache.org/jira/browse/AXIS2C-995
>             Project: Axis2-C
>          Issue Type: Bug
>          Components: core/transport
>    Affects Versions: 1.2.0
>         Environment: solaris 10 x86, apache 2.2.4
>            Reporter: Ben Wyckoff
>            Assignee: Supun Kamburugamuva
>             Fix For: 1.6.0
>
>         Attachments: mod_axis2_shut_down.patch
>
>
> mod_axis2 calls AXIS2_SVC_SKELETON_INIT but never calls AXIS2_SVC_SKELETON_FREE (or the equivalent), which leaves resources allocated at init time dangling. The axis2_hhtp_server does properly call free, allowing the service to properly clean up after itself.
> This issue was submitted to the axis2-c users list, and Dumindu Pallewela replied with the following patch.
> Index: mod_axis2.c
> ===================================================================
> --- mod_axis2.c	(revision 629362)
> +++ mod_axis2.c	(working copy)
> @@ -425,6 +425,19 @@
>  #endif
>  }
>  
> +typedef struct worker_cleanup_data
> +{
> +    const axutil_env_t * env;
> +    axis2_apache2_worker_t * worker;
> +} worker_cleanup_data_t;
> +
> +static apr_status_t worker_cleanup(void *data)
> +{
> +    worker_cleanup_data_t *d = (worker_cleanup_data_t *) data;
> +    axis2_apache2_worker_free(d->worker, d->env);
> +    return APR_SUCCESS;
> +}
> +
>  static int axis2_post_config(apr_pool_t *pconf, apr_pool_t *plog,
>  								 apr_pool_t *ptemp, server_rec *svr_rec)
>  {
> @@ -592,6 +605,14 @@
>                       "[Axis2] Error creating mod_axis2 apache2 worker");
>          exit(APEXIT_CHILDFATAL);
>      }
> +    else
> +    {
> +        worker_cleanup_data_t *data = apr_palloc(pconf, sizeof(worker_cleanup_data_t));
> +        data->env = axutil_env;
> +        data->worker = axis2_worker;
> +        apr_pool_cleanup_register(pconf, data, worker_cleanup, apr_pool_cleanup_null);
> +    }
> +
>  	return OK;
>  }
>  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (AXIS2C-995) mod_axis2 fails to call svc_skeleton_free

Posted by "Supun Kamburugamuva (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2C-995?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Supun Kamburugamuva resolved AXIS2C-995.
----------------------------------------

    Resolution: Fixed

Fixed the issue in the trunk. We are registering a cleanup with the pool passed to the child init method. When this pool get destroyed (this is the server pool) we are freeing the worker. 

> mod_axis2 fails to call svc_skeleton_free
> -----------------------------------------
>
>                 Key: AXIS2C-995
>                 URL: https://issues.apache.org/jira/browse/AXIS2C-995
>             Project: Axis2-C
>          Issue Type: Bug
>          Components: core/transport
>    Affects Versions: 1.2.0
>         Environment: solaris 10 x86, apache 2.2.4
>            Reporter: Ben Wyckoff
>            Assignee: Supun Kamburugamuva
>         Attachments: mod_axis2_shut_down.patch
>
>
> mod_axis2 calls AXIS2_SVC_SKELETON_INIT but never calls AXIS2_SVC_SKELETON_FREE (or the equivalent), which leaves resources allocated at init time dangling. The axis2_hhtp_server does properly call free, allowing the service to properly clean up after itself.
> This issue was submitted to the axis2-c users list, and Dumindu Pallewela replied with the following patch.
> Index: mod_axis2.c
> ===================================================================
> --- mod_axis2.c	(revision 629362)
> +++ mod_axis2.c	(working copy)
> @@ -425,6 +425,19 @@
>  #endif
>  }
>  
> +typedef struct worker_cleanup_data
> +{
> +    const axutil_env_t * env;
> +    axis2_apache2_worker_t * worker;
> +} worker_cleanup_data_t;
> +
> +static apr_status_t worker_cleanup(void *data)
> +{
> +    worker_cleanup_data_t *d = (worker_cleanup_data_t *) data;
> +    axis2_apache2_worker_free(d->worker, d->env);
> +    return APR_SUCCESS;
> +}
> +
>  static int axis2_post_config(apr_pool_t *pconf, apr_pool_t *plog,
>  								 apr_pool_t *ptemp, server_rec *svr_rec)
>  {
> @@ -592,6 +605,14 @@
>                       "[Axis2] Error creating mod_axis2 apache2 worker");
>          exit(APEXIT_CHILDFATAL);
>      }
> +    else
> +    {
> +        worker_cleanup_data_t *data = apr_palloc(pconf, sizeof(worker_cleanup_data_t));
> +        data->env = axutil_env;
> +        data->worker = axis2_worker;
> +        apr_pool_cleanup_register(pconf, data, worker_cleanup, apr_pool_cleanup_null);
> +    }
> +
>  	return OK;
>  }
>  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org


[jira] Reopened: (AXIS2C-995) mod_axis2 fails to call svc_skeleton_free

Posted by "Supun Kamburugamuva (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2C-995?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Supun Kamburugamuva reopened AXIS2C-995:
----------------------------------------


I'm reopening the issue due to httpd crashes sometimes when it is shutting down on windows. The segfault is random. Reverted the changes in the svn. 

> mod_axis2 fails to call svc_skeleton_free
> -----------------------------------------
>
>                 Key: AXIS2C-995
>                 URL: https://issues.apache.org/jira/browse/AXIS2C-995
>             Project: Axis2-C
>          Issue Type: Bug
>          Components: core/transport
>    Affects Versions: 1.2.0
>         Environment: solaris 10 x86, apache 2.2.4
>            Reporter: Ben Wyckoff
>            Assignee: Supun Kamburugamuva
>         Attachments: mod_axis2_shut_down.patch
>
>
> mod_axis2 calls AXIS2_SVC_SKELETON_INIT but never calls AXIS2_SVC_SKELETON_FREE (or the equivalent), which leaves resources allocated at init time dangling. The axis2_hhtp_server does properly call free, allowing the service to properly clean up after itself.
> This issue was submitted to the axis2-c users list, and Dumindu Pallewela replied with the following patch.
> Index: mod_axis2.c
> ===================================================================
> --- mod_axis2.c	(revision 629362)
> +++ mod_axis2.c	(working copy)
> @@ -425,6 +425,19 @@
>  #endif
>  }
>  
> +typedef struct worker_cleanup_data
> +{
> +    const axutil_env_t * env;
> +    axis2_apache2_worker_t * worker;
> +} worker_cleanup_data_t;
> +
> +static apr_status_t worker_cleanup(void *data)
> +{
> +    worker_cleanup_data_t *d = (worker_cleanup_data_t *) data;
> +    axis2_apache2_worker_free(d->worker, d->env);
> +    return APR_SUCCESS;
> +}
> +
>  static int axis2_post_config(apr_pool_t *pconf, apr_pool_t *plog,
>  								 apr_pool_t *ptemp, server_rec *svr_rec)
>  {
> @@ -592,6 +605,14 @@
>                       "[Axis2] Error creating mod_axis2 apache2 worker");
>          exit(APEXIT_CHILDFATAL);
>      }
> +    else
> +    {
> +        worker_cleanup_data_t *data = apr_palloc(pconf, sizeof(worker_cleanup_data_t));
> +        data->env = axutil_env;
> +        data->worker = axis2_worker;
> +        apr_pool_cleanup_register(pconf, data, worker_cleanup, apr_pool_cleanup_null);
> +    }
> +
>  	return OK;
>  }
>  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org


[jira] Commented: (AXIS2C-995) mod_axis2 fails to call svc_skeleton_free

Posted by "Senaka Fernando (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2C-995?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12571709#action_12571709 ] 

Senaka Fernando commented on AXIS2C-995:
----------------------------------------

Hi Ben,

I belive this does the required cleanup when we free the pool. This fits perfectly to the Axis2/C environment within apache server, as, a service is a persistent object within the scope of the lifetime of the engine, according to our current implementation. On a day someone introduces hot_deployment, he will have to consider this.

I have been following your discussion on the Axis2/C user list and I believe this is the best fit according to our current implementation. What I mean here is the use of a apr_pool_cleanup_register() and not the logic within the callback function.

Regards,
Senaka

> mod_axis2 fails to call svc_skeleton_free
> -----------------------------------------
>
>                 Key: AXIS2C-995
>                 URL: https://issues.apache.org/jira/browse/AXIS2C-995
>             Project: Axis2-C
>          Issue Type: Bug
>          Components: core/transport
>    Affects Versions: 1.2.0
>         Environment: solaris 10 x86, apache 2.2.4
>            Reporter: Ben Wyckoff
>
> mod_axis2 calls AXIS2_SVC_SKELETON_INIT but never calls AXIS2_SVC_SKELETON_FREE (or the equivalent), which leaves resources allocated at init time dangling. The axis2_hhtp_server does properly call free, allowing the service to properly clean up after itself.
> This issue was submitted to the axis2-c users list, and Dumindu Pallewela replied with the following patch.
> Index: mod_axis2.c
> ===================================================================
> --- mod_axis2.c	(revision 629362)
> +++ mod_axis2.c	(working copy)
> @@ -425,6 +425,19 @@
>  #endif
>  }
>  
> +typedef struct worker_cleanup_data
> +{
> +    const axutil_env_t * env;
> +    axis2_apache2_worker_t * worker;
> +} worker_cleanup_data_t;
> +
> +static apr_status_t worker_cleanup(void *data)
> +{
> +    worker_cleanup_data_t *d = (worker_cleanup_data_t *) data;
> +    axis2_apache2_worker_free(d->worker, d->env);
> +    return APR_SUCCESS;
> +}
> +
>  static int axis2_post_config(apr_pool_t *pconf, apr_pool_t *plog,
>  								 apr_pool_t *ptemp, server_rec *svr_rec)
>  {
> @@ -592,6 +605,14 @@
>                       "[Axis2] Error creating mod_axis2 apache2 worker");
>          exit(APEXIT_CHILDFATAL);
>      }
> +    else
> +    {
> +        worker_cleanup_data_t *data = apr_palloc(pconf, sizeof(worker_cleanup_data_t));
> +        data->env = axutil_env;
> +        data->worker = axis2_worker;
> +        apr_pool_cleanup_register(pconf, data, worker_cleanup, apr_pool_cleanup_null);
> +    }
> +
>  	return OK;
>  }
>  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org


[jira] Assigned: (AXIS2C-995) mod_axis2 fails to call svc_skeleton_free

Posted by "Supun Kamburugamuva (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2C-995?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Supun Kamburugamuva reassigned AXIS2C-995:
------------------------------------------

    Assignee: Supun Kamburugamuva

> mod_axis2 fails to call svc_skeleton_free
> -----------------------------------------
>
>                 Key: AXIS2C-995
>                 URL: https://issues.apache.org/jira/browse/AXIS2C-995
>             Project: Axis2-C
>          Issue Type: Bug
>          Components: core/transport
>    Affects Versions: 1.2.0
>         Environment: solaris 10 x86, apache 2.2.4
>            Reporter: Ben Wyckoff
>            Assignee: Supun Kamburugamuva
>
> mod_axis2 calls AXIS2_SVC_SKELETON_INIT but never calls AXIS2_SVC_SKELETON_FREE (or the equivalent), which leaves resources allocated at init time dangling. The axis2_hhtp_server does properly call free, allowing the service to properly clean up after itself.
> This issue was submitted to the axis2-c users list, and Dumindu Pallewela replied with the following patch.
> Index: mod_axis2.c
> ===================================================================
> --- mod_axis2.c	(revision 629362)
> +++ mod_axis2.c	(working copy)
> @@ -425,6 +425,19 @@
>  #endif
>  }
>  
> +typedef struct worker_cleanup_data
> +{
> +    const axutil_env_t * env;
> +    axis2_apache2_worker_t * worker;
> +} worker_cleanup_data_t;
> +
> +static apr_status_t worker_cleanup(void *data)
> +{
> +    worker_cleanup_data_t *d = (worker_cleanup_data_t *) data;
> +    axis2_apache2_worker_free(d->worker, d->env);
> +    return APR_SUCCESS;
> +}
> +
>  static int axis2_post_config(apr_pool_t *pconf, apr_pool_t *plog,
>  								 apr_pool_t *ptemp, server_rec *svr_rec)
>  {
> @@ -592,6 +605,14 @@
>                       "[Axis2] Error creating mod_axis2 apache2 worker");
>          exit(APEXIT_CHILDFATAL);
>      }
> +    else
> +    {
> +        worker_cleanup_data_t *data = apr_palloc(pconf, sizeof(worker_cleanup_data_t));
> +        data->env = axutil_env;
> +        data->worker = axis2_worker;
> +        apr_pool_cleanup_register(pconf, data, worker_cleanup, apr_pool_cleanup_null);
> +    }
> +
>  	return OK;
>  }
>  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org


[jira] Updated: (AXIS2C-995) mod_axis2 fails to call svc_skeleton_free

Posted by "Supun Kamburugamuva (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2C-995?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Supun Kamburugamuva updated AXIS2C-995:
---------------------------------------

    Attachment: mod_axis2_shut_down.patch

Here I have attached a patch which will allow us to call the axis2_svc_skeleton_free when Apache is shutting down. I have tested this on my machine and it works fine. I really appreciate if someone with more experience in this area have a look at the patch before I commit it.

> mod_axis2 fails to call svc_skeleton_free
> -----------------------------------------
>
>                 Key: AXIS2C-995
>                 URL: https://issues.apache.org/jira/browse/AXIS2C-995
>             Project: Axis2-C
>          Issue Type: Bug
>          Components: core/transport
>    Affects Versions: 1.2.0
>         Environment: solaris 10 x86, apache 2.2.4
>            Reporter: Ben Wyckoff
>            Assignee: Supun Kamburugamuva
>         Attachments: mod_axis2_shut_down.patch
>
>
> mod_axis2 calls AXIS2_SVC_SKELETON_INIT but never calls AXIS2_SVC_SKELETON_FREE (or the equivalent), which leaves resources allocated at init time dangling. The axis2_hhtp_server does properly call free, allowing the service to properly clean up after itself.
> This issue was submitted to the axis2-c users list, and Dumindu Pallewela replied with the following patch.
> Index: mod_axis2.c
> ===================================================================
> --- mod_axis2.c	(revision 629362)
> +++ mod_axis2.c	(working copy)
> @@ -425,6 +425,19 @@
>  #endif
>  }
>  
> +typedef struct worker_cleanup_data
> +{
> +    const axutil_env_t * env;
> +    axis2_apache2_worker_t * worker;
> +} worker_cleanup_data_t;
> +
> +static apr_status_t worker_cleanup(void *data)
> +{
> +    worker_cleanup_data_t *d = (worker_cleanup_data_t *) data;
> +    axis2_apache2_worker_free(d->worker, d->env);
> +    return APR_SUCCESS;
> +}
> +
>  static int axis2_post_config(apr_pool_t *pconf, apr_pool_t *plog,
>  								 apr_pool_t *ptemp, server_rec *svr_rec)
>  {
> @@ -592,6 +605,14 @@
>                       "[Axis2] Error creating mod_axis2 apache2 worker");
>          exit(APEXIT_CHILDFATAL);
>      }
> +    else
> +    {
> +        worker_cleanup_data_t *data = apr_palloc(pconf, sizeof(worker_cleanup_data_t));
> +        data->env = axutil_env;
> +        data->worker = axis2_worker;
> +        apr_pool_cleanup_register(pconf, data, worker_cleanup, apr_pool_cleanup_null);
> +    }
> +
>  	return OK;
>  }
>  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org