You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Graham Leggett <mi...@sharp.fm> on 2011/12/02 23:57:27 UTC

Re: svn commit: r1209754 - in /httpd/httpd/trunk/modules/proxy: ./ balancers/

On 03 Dec 2011, at 12:42 AM, minfrin@apache.org wrote:

> Author: minfrin
> Date: Fri Dec  2 22:42:39 2011
> New Revision: 1209754
> 
> URL: http://svn.apache.org/viewvc?rev=1209754&view=rev
> Log:
> mod_proxy: Make ap_proxy_retry_worker() into an optional function. Allows
> mod_lbmethod_bybusyness, mod_lbmethod_byrequests, mod_lbmethod_bytraffic
> and mod_lbmethod_heartbeat to be loaded without mod_proxy yet being present,
> which happens when modules are loaded in alphabetical order.

The proxy modules need a bunch more refactoring like this so that the modules can be loaded cleanly in any order.

Right now, we've gotten away with this due to the alphabetical naming of the proxy modules, sorted alphabetically mod_proxy comes before mod_proxy_http, and it just so happens mod_proxy_http depends on a lot of symbols provided by mod_proxy, so we work by accident.

The above change solves the problem for the mod_lbmethod_* modules, which sort alphabetically before mod_proxy and so cause a problem for people.

While I want to backport this change to v2.4, we don't have to backport the rest of the changes if doing so will delay httpd v2.4 for any length of time. Right now I have a bit of time, so am keen to do it.

There are also functions in mod_proxy that are only used by a single mod_proxy_* module which ideally should be moved to the module that needs it.

The full picture of the functions affected when mod_proxy is not loaded but everything else is looks like below. Seems like there is a lot of stuff that ideally should be moved from mod_proxy to mod_proxy_balancer.

Undefined symbols:
  "_ap_proxy_canon_netloc", referenced from:
      _proxy_ftp_canon in libmod_proxy_ftp.a(mod_proxy_ftp.o)
      _proxy_balancer_canon in libmod_proxy_balancer.a(mod_proxy_balancer.o)
      _proxy_http_canon in libmod_proxy_http.a(mod_proxy_http.o)
  "_ap_proxy_initialize_balancer", referenced from:
      _balancer_child_init in libmod_proxy_balancer.a(mod_proxy_balancer.o)
  "_ap_proxy_acquire_connection", referenced from:
      _proxy_ftp_handler in libmod_proxy_ftp.a(mod_proxy_ftp.o)
      _proxy_http_handler in libmod_proxy_http.a(mod_proxy_http.o)
  "_ap_proxy_pre_http_request", referenced from:
      _ap_proxy_http_process_response in libmod_proxy_http.a(mod_proxy_http.o)
  "_ap_proxy_location_reverse_map", referenced from:
      _transform_hdrs.13192 in libmod_proxy_http.a(mod_proxy_http.o)
      _transform_hdrs.13192 in libmod_proxy_http.a(mod_proxy_http.o)
      _transform_hdrs.13192 in libmod_proxy_http.a(mod_proxy_http.o)
      _transform_hdrs.13192 in libmod_proxy_http.a(mod_proxy_http.o)
  "_ap_proxy_string_read", referenced from:
      _ftp_getrc_msg in libmod_proxy_ftp.a(mod_proxy_ftp.o)
      _ftp_getrc_msg in libmod_proxy_ftp.a(mod_proxy_ftp.o)
  "_ap_proxy_canonenc", referenced from:
      _proxy_ftp_canon in libmod_proxy_ftp.a(mod_proxy_ftp.o)
      _proxy_ftp_canon in libmod_proxy_ftp.a(mod_proxy_ftp.o)
      _proxy_ftp_canon in libmod_proxy_ftp.a(mod_proxy_ftp.o)
      _proxy_ftp_canon in libmod_proxy_ftp.a(mod_proxy_ftp.o)
      _proxy_balancer_canon in libmod_proxy_balancer.a(mod_proxy_balancer.o)
      _proxy_http_canon in libmod_proxy_http.a(mod_proxy_http.o)
  "_proxy_hook_post_request", referenced from:
      _ap_proxy_balancer_register_hook in libmod_proxy_balancer.a(mod_proxy_balancer.o)
  "_ap_proxy_initialize_worker", referenced from:
      _init_balancer_members in libmod_proxy_balancer.a(mod_proxy_balancer.o)
      _balancer_handler in libmod_proxy_balancer.a(mod_proxy_balancer.o)
  "_ap_proxy_liststr", referenced from:
      _ap_proxy_http_process_response in libmod_proxy_http.a(mod_proxy_http.o)
  "_ap_proxy_parse_wstatus", referenced from:
      _balancer_handler in libmod_proxy_balancer.a(mod_proxy_balancer.o)
  "_ap_proxy_ssl_enable", referenced from:
      _proxy_http_handler in libmod_proxy_http.a(mod_proxy_http.o)
  "_ap_proxy_ssl_connection_cleanup", referenced from:
      _proxy_http_handler in libmod_proxy_http.a(mod_proxy_http.o)
  "_ap_proxy_get_balancer", referenced from:
      _proxy_balancer_pre_request in libmod_proxy_balancer.a(mod_proxy_balancer.o)
      _balancer_handler in libmod_proxy_balancer.a(mod_proxy_balancer.o)
  "_ap_proxy_connect_backend", referenced from:
      _proxy_ftp_handler in libmod_proxy_ftp.a(mod_proxy_ftp.o)
      _proxy_http_handler in libmod_proxy_http.a(mod_proxy_http.o)
  "_ap_proxy_date_canon", referenced from:
      _process_proxy_header in libmod_proxy_http.a(mod_proxy_http.o)
  "_ap_proxy_release_connection", referenced from:
      _proxy_ftp_cleanup in libmod_proxy_ftp.a(mod_proxy_ftp.o)
      _proxy_ftp_handler in libmod_proxy_ftp.a(mod_proxy_ftp.o)
      _ap_proxy_http_process_response in libmod_proxy_http.a(mod_proxy_http.o)
      _ap_proxy_http_process_response in libmod_proxy_http.a(mod_proxy_http.o)
      _ap_proxy_http_cleanup in libmod_proxy_http.a(mod_proxy_http.o)
  "_ap_proxy_ssl_disable", referenced from:
      _proxy_ftp_handler in libmod_proxy_ftp.a(mod_proxy_ftp.o)
  "_ap_proxy_set_wstatus", referenced from:
      _balancer_handler in libmod_proxy_balancer.a(mod_proxy_balancer.o)
      _balancer_handler in libmod_proxy_balancer.a(mod_proxy_balancer.o)
      _balancer_handler in libmod_proxy_balancer.a(mod_proxy_balancer.o)
      _balancer_handler in libmod_proxy_balancer.a(mod_proxy_balancer.o)
      _balancer_handler in libmod_proxy_balancer.a(mod_proxy_balancer.o)
  "_ap_proxy_cookie_reverse_map", referenced from:
      _transform_hdrs.13192 in libmod_proxy_http.a(mod_proxy_http.o)
  "_ap_proxy_share_worker", referenced from:
      _balancer_post_config in libmod_proxy_balancer.a(mod_proxy_balancer.o)
      _balancer_handler in libmod_proxy_balancer.a(mod_proxy_balancer.o)
  "_ap_proxy_hex2c", referenced from:
      _decodeenc in libmod_proxy_ftp.a(mod_proxy_ftp.o)
      _ftp_check_string in libmod_proxy_ftp.a(mod_proxy_ftp.o)
  "_ap_proxy_connection_create", referenced from:
      _proxy_ftp_handler in libmod_proxy_ftp.a(mod_proxy_ftp.o)
      _proxy_http_handler in libmod_proxy_http.a(mod_proxy_http.o)
  "_ap_proxy_define_worker", referenced from:
      _balancer_handler in libmod_proxy_balancer.a(mod_proxy_balancer.o)
  "_ap_proxy_share_balancer", referenced from:
      _balancer_post_config in libmod_proxy_balancer.a(mod_proxy_balancer.o)
  "_ap_proxy_determine_connection", referenced from:
      _proxy_http_handler in libmod_proxy_http.a(mod_proxy_http.o)
  "_ap_proxy_make_fake_req", referenced from:
      _ap_proxy_http_process_response in libmod_proxy_http.a(mod_proxy_http.o)
  "_ap_proxy_get_worker", referenced from:
      _balancer_handler in libmod_proxy_balancer.a(mod_proxy_balancer.o)
      _balancer_handler in libmod_proxy_balancer.a(mod_proxy_balancer.o)
  "_ap_proxyerror", referenced from:
      _ftp_set_TYPE in libmod_proxy_ftp.a(mod_proxy_ftp.o)
      _ftp_set_TYPE in libmod_proxy_ftp.a(mod_proxy_ftp.o)
      _ftp_get_PWD in libmod_proxy_ftp.a(mod_proxy_ftp.o)
      _ftp_proxyerror in libmod_proxy_ftp.a(mod_proxy_ftp.o)
      _proxy_ftp_handler in libmod_proxy_ftp.a(mod_proxy_ftp.o)
      _proxy_ftp_handler in libmod_proxy_ftp.a(mod_proxy_ftp.o)
      _proxy_ftp_handler in libmod_proxy_ftp.a(mod_proxy_ftp.o)
      _proxy_ftp_handler in libmod_proxy_ftp.a(mod_proxy_ftp.o)
      _proxy_ftp_handler in libmod_proxy_ftp.a(mod_proxy_ftp.o)
      _rewrite_url in libmod_proxy_balancer.a(mod_proxy_balancer.o)
      _pass_brigade in libmod_proxy_http.a(mod_proxy_http.o)
      _ap_proxy_http_process_response in libmod_proxy_http.a(mod_proxy_http.o)
      _ap_proxy_http_process_response in libmod_proxy_http.a(mod_proxy_http.o)
      _ap_proxy_http_process_response in libmod_proxy_http.a(mod_proxy_http.o)
      _ap_proxy_http_process_response in libmod_proxy_http.a(mod_proxy_http.o)
  "_ap_proxy_strncpy", referenced from:
      _balancer_handler in libmod_proxy_balancer.a(mod_proxy_balancer.o)
      _balancer_handler in libmod_proxy_balancer.a(mod_proxy_balancer.o)
      _balancer_handler in libmod_proxy_balancer.a(mod_proxy_balancer.o)
      _balancer_handler in libmod_proxy_balancer.a(mod_proxy_balancer.o)
  "_ap_proxy_backend_broke", referenced from:
      _ap_proxy_http_process_response in libmod_proxy_http.a(mod_proxy_http.o)
      _ap_proxy_http_process_response in libmod_proxy_http.a(mod_proxy_http.o)
  "_proxy_run_fixups", referenced from:
      _ap_proxy_http_request in libmod_proxy_http.a(mod_proxy_http.o)
  "_ap_proxy_sync_balancer", referenced from:
      _proxy_balancer_pre_request in libmod_proxy_balancer.a(mod_proxy_balancer.o)
      _balancer_handler in libmod_proxy_balancer.a(mod_proxy_balancer.o)
  "_proxy_hook_canon_handler", referenced from:
      _ap_proxy_ftp_register_hook in libmod_proxy_ftp.a(mod_proxy_ftp.o)
      _ap_proxy_balancer_register_hook in libmod_proxy_balancer.a(mod_proxy_balancer.o)
      _ap_proxy_http_register_hook in libmod_proxy_http.a(mod_proxy_http.o)
  "_proxy_hook_scheme_handler", referenced from:
      _ap_proxy_ftp_register_hook in libmod_proxy_ftp.a(mod_proxy_ftp.o)
      _ap_proxy_http_register_hook in libmod_proxy_http.a(mod_proxy_http.o)
  "_proxy_module", referenced from:
      _xlate_name in libmod_proxy_express.a(mod_proxy_express.o)
      _lock_remove in libmod_proxy_balancer.a(mod_proxy_balancer.o)
      _balancer_post_config in libmod_proxy_balancer.a(mod_proxy_balancer.o)
      _balancer_post_config in libmod_proxy_balancer.a(mod_proxy_balancer.o)
      _balancer_handler in libmod_proxy_balancer.a(mod_proxy_balancer.o)
      _balancer_child_init in libmod_proxy_balancer.a(mod_proxy_balancer.o)
      _ap_proxy_http_request in libmod_proxy_http.a(mod_proxy_http.o)
      _ap_proxy_read_headers in libmod_proxy_http.a(mod_proxy_http.o)
      _ap_proxy_read_headers in libmod_proxy_http.a(mod_proxy_http.o)
      _ap_proxy_http_process_response in libmod_proxy_http.a(mod_proxy_http.o)
  "_ap_proxy_buckets_lifetime_transform", referenced from:
      _ap_proxy_http_process_response in libmod_proxy_http.a(mod_proxy_http.o)
  "_ap_proxy_checkproxyblock", referenced from:
      _proxy_ftp_handler in libmod_proxy_ftp.a(mod_proxy_ftp.o)
  "_proxy_hook_pre_request", referenced from:
      _ap_proxy_balancer_register_hook in libmod_proxy_balancer.a(mod_proxy_balancer.o)

Regards,
Graham
--


Re: svn commit: r1209754 - in /httpd/httpd/trunk/modules/proxy: ./ balancers/

Posted by Stefan Fritsch <sf...@sfritsch.de>.
On Friday 02 December 2011, Graham Leggett wrote:
> On 03 Dec 2011, at 12:42 AM, minfrin@apache.org wrote:
> > Author: minfrin
> > Date: Fri Dec  2 22:42:39 2011
> > New Revision: 1209754
> >
> > 
> >
> > URL: http://svn.apache.org/viewvc?rev=1209754&view=rev
> > Log:
> > mod_proxy: Make ap_proxy_retry_worker() into an optional
> > function. Allows mod_lbmethod_bybusyness,
> > mod_lbmethod_byrequests, mod_lbmethod_bytraffic and
> > mod_lbmethod_heartbeat to be loaded without mod_proxy yet being
> > present, which happens when modules are loaded in alphabetical
> > order.
> 
> The proxy modules need a bunch more refactoring like this so that
> the modules can be loaded cleanly in any order.
> 
> Right now, we've gotten away with this due to the alphabetical
> naming of the proxy modules, sorted alphabetically mod_proxy comes
> before mod_proxy_http, and it just so happens mod_proxy_http
> depends on a lot of symbols provided by mod_proxy, so we work by
> accident.
> 
> The above change solves the problem for the mod_lbmethod_* modules,
> which sort alphabetically before mod_proxy and so cause a problem
> for people.
> 
> While I want to backport this change to v2.4, we don't have to
> backport the rest of the changes if doing so will delay httpd v2.4
> for any length of time. Right now I have a bit of time, so am keen
> to do it.
> 
> There are also functions in mod_proxy that are only used by a
> single mod_proxy_* module which ideally should be moved to the
> module that needs it.

There are also a bunch of utility functions that take a function name 
as argument for logging. I think this should actually be replaced by a 
module_index argument, which should then be passed to ap_log_*. This 
way the utility functions would write log messages in the name of the 
calling module, and be subject of the log config of the calling 
module.

But that's a bit late for 2.4, too.