Details
-
Bug
-
Status: Resolved
-
Blocker
-
Resolution: Fixed
-
1.5.0, 1.6.0
-
None
-
All
Description
This problem affects at least 1.5.0 and 1.6.0. I haven't checked any earlier versions.
When viewing the wsdl via services/ServiceName?wsdl
the wsdl is opened with a call to fopen and the result assigned to a local FILE* variable. However there is no corresponding call to fclose.
We have a monitoring script that periodically requests the wsdl to check that the service is available.
The process (currently) has a limit of 1024 open file handles, eventually this leak causes that number to be exceeded.
The client library we use to connect to the service also requests the wsdl file when connecting to the service.
With reference to the code in the 1.6.0 release, here is the 1 liner to plug the leak.
Regards,
Matt
core/transport/http/util/http_transport_utils.c
1882 wsdl_file = fopen(wsdl_path, "r");
1883 if (wsdl_file)
1884 {
1885 c = fgetc(wsdl_file);
1886 while (c != EOF)
1887 {
1888 if (i >= size)
1889
1896 content[i++] = (axis2_char_t)c;
1897 c = fgetc(wsdl_file);
1898 }
1899 content[i] = AXIS2_ESC_NULL;
1900 wsdl_string = (axis2_char_t *)content;
1901 fclose(wsdl_file); <---- Added this line
1902 }