Occasionally, when we restart our Wowza server, the ModuleLoadBalancerRedirector instances will load before the ServerListenerLoadBalancerListener instance. Here's my understanding of what's happening:
1) Wowza binds to port 1935.
2) Client connects to Wowza using the application redirect_175.41.136.177/_definst_.
3) Wowza initializes the application and creates an instance of ModuleLoadBalancerRedirector.
4) Since no ServerListenerLoadBalancerListener has been created yet, the ModuleLoastBalancerRedirector instance initializes its listener variable to null.
5) The client receives an error message and disconnects.
6) The ServerListenerLoadBalancerListener instance is created.
7) Wowza reports that the server is started.
I've selected a few lines from our log file to show exactly what's happening:
I've noticed that HTTPLoadBalancerRedirector successfully recovers in this case, so I patched ModuleLoadBalancerRedirector.java to mirror what it's doing. Basically, the fix is to re-initialize the listener variable on every request if it's null. I haven't tried compiling this code or testing it because I assume whoever looks at it will have their own set of changes and tests they want to make.Code:2011-10-18 00:00:28 EDT vhost-start vhost INFO 200 _defaultVHost_ - - - - 4.787 - - - - - - - - - - - - - - - - - - - - - - - - - 2011-10-18 00:00:29 EDT comment server WARN 200 - HTTPLoadBalancerRedirector.constructor: LoadBalancerListener not found. - - - 5.875 - - - - - - - - - - - - - - - - - - - - - - - - - 2011-10-18 00:00:30 EDT comment server WARN 200 - HTTPLoadBalancerRedirector.constructor: LoadBalancerListener not found. - - - 5.984 - - - - - - - - - - - - - - - - - - - - - - - - - 2011-10-18 00:00:30 EDT comment server WARN 200 - ModuleLoadBalancerRedirector.onAppStart[redirect_175.41.136.177/_definst_]: LoadBalancerListener not found. All connections to this application will be refused. - - - 6.316 - - - - - - - - - - - - - - - - - - - - - - - - - 2011-10-18 00:00:30 EDT comment server INFO 200 - ModuleLoadBalancerRedirector.onAppStart: redirect_175.41.136.177/_definst_ - - - 6.317 - - - - - - - - - - - - - - - - - - - - - - - - - 2011-10-18 00:00:30 EDT app-start application INFO 200 _definst_ redirect_175.41.136.177/_definst_ - - - 6.42 - - - - - - - - - - - - - - - - - - - - - - - - 2011-10-18 00:00:30 EDT connect-pending session INFO 100 71.227.178.240 - _defaultVHost_ redirect_175.41.136.177 _definst_ 0.961 [any] 443 rtmp://wowza-lb.dyyno.com:443/redirect_175.41.136.177/ 71.227.178.240 rtmp http://www.dyyno.com/assets/players/dyynoplayer-17419.swf WIN 10,3,183,5 214170813 3518 3073 - - - - - - - - - - - - - rtmp://wowza-lb.dyyno.com:443/redirect_175.41.136.177/ - 2011-10-18 00:00:30 EDT connect session INFO 401 71.227.178.240 - _defaultVHost_ redirect_175.41.136.177 _definst_ 1.018 [any] 443 rtmp://wowza-lb.dyyno.com:443/redirect_175.41.136.177/ 71.227.178.240 rtmp http://www.dyyno.com/assets/players/dyynoplayer-17419.swf WIN 10,3,183,5 214170813 3518 3073 - - - - - - - - - - - - - rtmp://wowza-lb.dyyno.com:443/redirect_175.41.136.177/ - 2011-10-18 00:00:30 EDT comment server INFO 200 - ServerListenerLoadBalancerListener.onServerInit - - - 6.672 - - - - - - - - - - - - - - - - - - - - - - - - - 2011-10-18 00:00:30 EDT comment server INFO 200 - LoadBalancerListener.bind: 0.0.0.0/0.0.0.0:1934 - - - 6.7 - - - - - - - - - - - - - - - - - - - - - - - - - 2011-10-18 00:00:31 EDT comment server INFO 200 - Wowza Media Server is started! - - - 7.757 - - - - - - - - - - - - - - - - - - - - - - - - -
Please let me know if you have any questions. Thanks!Code:30a31,56 > > private ILoadBalancerRedirector getRedirector(IClient client) > { > if (this.redirector == null) > { > while(true) > { > this.listener = (LoadBalancerListener)Server.getInstance().getProperties().get(ServerListenerLoadBalancerListener.PROP_LOADBALANCERLISTENER); > if (this.listener == null) > { > getLogger().warn("ModuleLoadBalancerRedirector.onAppStart["+getFullName(client)+"]: LoadBalancerListener not found. All connections to this application will be refused."); > break; > } > > this.redirector = this.listener.getRedirector(); > if (this.redirector == null) > { > getLogger().warn("ModuleLoadBalancerRedirector.onAppStart["+getFullName(client)+"]: ILoadBalancerRedirector not found. All connections to this application will be refused."); > break; > } > break; > } > } > > return this.redirector; > } 40a67,68 > > getRedirector(appInstance); 42,58d69 < while(true) < { < this.listener = (LoadBalancerListener)Server.getInstance().getProperties().get(ServerListenerLoadBalancerListener.PROP_LOADBALANCERLISTENER); < if (this.listener == null) < { < getLogger().warn("ModuleLoadBalancerRedirector.onAppStart["+getFullName(appInstance)+"]: LoadBalancerListener not found. All connections to this application will be refused."); < break; < } < < this.redirector = this.listener.getRedirector(); < if (this.redirector == null) < { < getLogger().warn("ModuleLoadBalancerRedirector.onAppStart["+getFullName(appInstance)+"]: ILoadBalancerRedirector not found. All connections to this application will be refused."); < break; < } < break; < } 69a81,82 > > getRedirector(); 101a115 > getRedirector();
-Greg


Reply With Quote