Hi Mathias, a looked at your patch and I think there are two bugs:
1) You set in_recovering of a woker which is in error_state to JK_TRUE even if you don't select him for handling the request. This should be moved into the next if clause when the worker is choosen. 2) When a local/main worker goes down and was set to error_state it would never be asked again. Because if the local/main worker was in error and the time for a new test has come you set rc only to this worker if it is no local worker and this will never be true. And because of this and 1) in_recovering == JK_TRUE, so it is dead for ever. Thats why I have a more complicated if-statement in my patch. When I check if the worker is in error state and this is true, I have to check if I can take it anyway. Because I can't reach the else part of the if anymore. My test environment is like in the explanation of my patch: I got two nodes with one apache and tomcat on each node. So I have only one local_worker per node and the mode is reject. When I shutdown tomcat I got an error. But after starting up tomcat again it is still unreachable. Bernd Mathias Herberts wrote: > Here is my patch to the load balancing code. I have tested the jk1 > part but not the jk2. The behavior should be identical though. > > The concept of local worker is introduced. Local workers form a subset > of the balanced workers, those workers handle the requests with no > session information or requests with session info but whose worker has > failed. > > The list of local workers is specified in the workers.properties files > as follows: > > worker.lb.balanced_workers=w1,w2,w3,w4,w5,w6 > worker.lb.local_workers=w4,w6 > > Internally the module will rearrange the workers' list so that the > local workers appear first in the list. For the example above the list > will be rearranged as: > > w4,w6,w3,w1,w5,w2 > > When a request comes in it is either part of a session or not. If the > request is part of a session then the worker having created the > session is selected (according to the session route appearing in the > session id). If this worker has failed, the request is considered > sessionless. For requests without a session, the workers' list is > scanned from the beginning, selecting the worker not in error with the > lowest lb_value. When the last local worker is reached, two > alternatives exist depending on the value of the fault_action > property. If fault_action is set to reject then if a worker was > selected it is returned as the most suitable worker for the request, > if no worker was selected so far, meaning all local workers are in > error, a null value is returned as the most suitable worker, meaning > the request is in error. If fault_action is set to balance, the > selection processs continues. > > For jk1, if fault_action is set to balance, non local workers in error > can be selected to handle the request. In jk2 in error workers are > never selected. > > The fault_action is specified as follows: > > worker.lb.fault_action={reject|balance} > > With my patch, the lb_value or lb_factor needs not to have a special > value to handle local workers. Thus lb_value is modified at each > request handled by the worker. > > > Feedback is welcome, testing of jk2 needs to be done. > > Mathias. > [...] -- Dipl.-Inform. Bernd Koecke UNIX-Entwicklung Schlund+Partner AG Fon: +49-721-91374-0 E-Mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>