Re: svn commit: r763298 - in /tomcat/trunk/java/org/apache/catalina: core/StandardContext.java core/StandardHost.java tribes/membership/Membership.java util/InstanceSupport.java util/LifecycleSuppor
sebb wrote: On 10/04/2009, Mark Thomas wrote: Filip Hanik - Dev Lists wrote: I'm generally against this find bugs 'may be bugs' issues. > is there an actual bug here? Reported bug, no. Bugs uses could hit, yes. Hence why this is in trunk and not being proposed for backport. Are all the syncs necessary? I haven't looked in detail but I suspect that right now, that most of them are not. As we increase JMX functionality and have more dynamic configuration then we'll almost certainly need them so I don't see the harm in getting this right now. I've no idea why this is related to JMX. Synchronization is not only about preventing lost updates, it is also about ensuring proper publication. If thread A writes to a non-volatile variable, thread B is only guaranteed to see the latest copy of the variable if both thread A and thread B use synchronization on the *same* variable. Without synch., thread B may never see the updated variable. Indeed it may see an updated reference but an incomplete object. Most of the time, a synchronized setter/unsynchronized getter will work just fine. However, this does not mean that it will always work. We *all* understand what the tool is reporting. However, the tool is not looking at the entire picture, hence thinking the tool is right on everything, is simple meaningless. Filip Mark > > Filip > > ma...@apache.org wrote: >> Author: markt >> Date: Wed Apr 8 16:08:42 2009 >> New Revision: 763298 >> >> URL: http://svn.apache.org/viewvc?rev=763298&view=rev >> Log: >> Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=46990 >> Various sync issues. >> >> Modified: >> tomcat/trunk/java/org/apache/catalina/core/StandardContext.java >> tomcat/trunk/java/org/apache/catalina/core/StandardHost.java >> >> tomcat/trunk/java/org/apache/catalina/tribes/membership/Membership.java >> tomcat/trunk/java/org/apache/catalina/util/InstanceSupport.java >> tomcat/trunk/java/org/apache/catalina/util/LifecycleSupport.java >> >> Modified: tomcat/trunk/java/org/apache/catalina/core/StandardContext.java >> URL: >> http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardContext.java?rev=763298&r1=763297&r2=763298&view=diff >> >> == >> >> --- tomcat/trunk/java/org/apache/catalina/core/StandardContext.java >> (original) >> +++ tomcat/trunk/java/org/apache/catalina/core/StandardContext.java >> Wed Apr 8 16:08:42 2009 >> @@ -201,6 +201,8 @@ >> * application, in the order they were encountered in the web.xml >> file. >> */ >> private String applicationListeners[] = new String[0]; >> ++private final Object applicationListenersLock = new Object(); >> >> >> /** >> @@ -223,6 +225,8 @@ >> private ApplicationParameter applicationParameters[] = >> new ApplicationParameter[0]; >> >> +private final Object applicationParametersLock = new Object(); >> + >> /** >> * The application available flag for this Context. >> @@ -263,6 +267,8 @@ >> * The security constraints for this web application. >> */ >> private SecurityConstraint constraints[] = new >> SecurityConstraint[0]; >> ++private final Object constraintsLock = new Object(); >> >> >> /** >> @@ -364,6 +370,9 @@ >> * defined in the deployment descriptor. >> */ >> private FilterMap filterMaps[] = new FilterMap[0]; >> ++private final Object filterMapsLock = new Object(); >> + >> >> /** >> * Filter mappings added via {...@link ServletContext} may have to >> be inserted >> @@ -388,6 +397,8 @@ >> */ >> private String instanceListeners[] = new String[0]; >> >> +private final Object instanceListenersLock = new Object(); >> + >> >> /** >> * The login configuration descriptor for this web application. >> @@ -508,6 +519,8 @@ >> */ >> private String securityRoles[] = new String[0]; >> >> +private final Object securityRolesLock = new Object(); >> + >> >> /** >> * The servlet mappings for this web application, keyed by >> @@ -515,6 +528,8 @@ >> */ >> private HashMap servletMappings = >> new HashMap(); >> ++private final Object servletMappingsLock = new Object(); >> >> >> /** >> @@ -559,12 +574,16 @@ >> */ >> private String watchedResources[] = new String[0]; >> >> +private final Object watchedResourcesLock = new Object(); >> + >> >> /** >> * The welcome files for this application. >> */ >> private String welcomeFiles[] = new String[0]; >> >> +private final Object welcomeFilesLock = new Object(); >> + >> >> /** >> * The set of classnames of LifecycleListeners that will be added >> @@ -572,6 +591,7 @@ >> */ >> private String wrapperLif
Re: svn commit: r763298 - in /tomcat/trunk/java/org/apache/catalina: core/StandardContext.java core/StandardHost.java tribes/membership/Membership.java util/InstanceSupport.java util/LifecycleSupport.
Ian Darwin wrote: Filip Hanik - Dev Lists wrote: I'm generally against this find bugs 'may be bugs' issues. is there an actual bug here? It's generally making the code "better". What do you object to about it? very simple, if one is about to refactor code, how about removing syncs and using simple yet more efficient concurrency. right now, all we're doing is aligning with an automatic tool to avoid warnings, when we gain nothing and risks bugs where there previously werent any. Filip - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: svn commit: r763726 - in /tomcat/trunk/java/org/apache/catalina/ha/backend: HeartbeatListener.java MultiCastSender.java Proxy.java Sender.java TcpSender.java
jean-frederic clere wrote: Filip Hanik - Dev Lists wrote: jean-frederic clere wrote: It requires some new code in httpd-trunk to work... sounds like you're reinventing the wheel in tomcat trunk to avoid code in httpd trunk :) Not completely :) The logic in httpd-trunk is for a multicast socket I want to use a normal socket and a handler in httpd to process http requests from Tomcat. what's a 'normal' socket? TCP? do you wanna elaborate on what you are trying to do? There is plenty of code in there, that if nothing else, you could copy/paste, the tomcat way :), to avoid creating something new. I'm fine either way, I just wanted to notify you of work that probably already does everything you are trying to do, and some more. Well I have more in mod_cluster but I think a more simple "tool" could be nice too. mod_cluster is in httpd-trunk now? If you think there is already some code in ASF give some pointers... I was doing a prototype, in the train after the ApacheCon, based on comments from Paul Freemantle and other httpd committers but not really searching if something already exists. feel free to elaborate on what you are trying to do, then I can give some better hints. I think for one, you don't need to talk multicast, nor even TCP if all you are trying to do is smarter load balancing. That can all be done piggy backing on existing logic. For example, instead of CPING/CPONG, like AJP does, this can easily be achieved using the Expect/Continue headers. You set your LB fail over timeout, send the HTTP request Once you get your 100-Continue, you increase the timeout to process the rest of the request. This will solve most of the problems of Tomcat being in an out of memory state, stale connections etc. Right now, looking for heart beat, multicast senders, tcp sender, proxy, sounds like you may be going away from KISS. cheerios Filip Cheers Jean-Frederic Cheers Jean-Frederic - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: svn commit: r763635 - in /tomcat/trunk/java/org/apache/catalina/ha/backend: HeartbeatListener.java MultiCastSender.java Sender.java
On 09/04/2009, jfcl...@apache.org wrote: > Author: jfclere > Date: Thu Apr 9 13:00:21 2009 > New Revision: 763635 > > URL: http://svn.apache.org/viewvc?rev=763635&view=rev > Log: > Move the multi logic to MultiCastSender with > the idea to TCP sockets and a list of proxy too. > > Added: > tomcat/trunk/java/org/apache/catalina/ha/backend/MultiCastSender.java > tomcat/trunk/java/org/apache/catalina/ha/backend/Sender.java Should have svn:eol-style=native property ... > Modified: > tomcat/trunk/java/org/apache/catalina/ha/backend/HeartbeatListener.java > > Modified: > tomcat/trunk/java/org/apache/catalina/ha/backend/HeartbeatListener.java > URL: > http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ha/backend/HeartbeatListener.java?rev=763635&r1=763634&r2=763635&view=diff > > == > --- tomcat/trunk/java/org/apache/catalina/ha/backend/HeartbeatListener.java > (original) > +++ tomcat/trunk/java/org/apache/catalina/ha/backend/HeartbeatListener.java > Thu Apr 9 13:00:21 2009 > @@ -55,8 +55,6 @@ > public void setPort(int port) { this.port = port; } > > /* for multicasting stuff */ > -MulticastSocket s = null; > -InetAddress group = null; > String ip = "224.0.1.105"; /* Multicast IP */ > int multiport = 23364; /* Multicast Port */ > int ttl = 16; > @@ -70,23 +68,17 @@ > > private CollectedInfo coll = null; > > +private Sender sender = null; > + > public void containerEvent(ContainerEvent event) { > } > > public void lifecycleEvent(LifecycleEvent event) { > Object source = event.getLifecycle(); > if (Lifecycle.PERIODIC_EVENT.equals(event.getType())) { > -if (s == null) { > -try { > -group = InetAddress.getByName(ip); > -s = new MulticastSocket(port); > -s.setTimeToLive(16); > -s.joinGroup(group); > -} catch (Exception ex) { > -log.error("Unable to use multicast: " + ex); > -s = null; > -return; > -} > +if (sender == null) { > +sender = new MultiCastSender(); > +sender.init(this); > } > > /* Read busy and ready */ > @@ -108,19 +100,10 @@ > } > String output = new String(); > output = "v=1&ready=" + coll.ready + "&busy=" + coll.busy; > -byte[] buf; > -try { > -buf = output.getBytes("US-ASCII"); > -} catch (UnsupportedEncodingException ex) { > -buf = output.getBytes(); > -} > -DatagramPacket data = new DatagramPacket(buf, buf.length, > group, multiport); > try { > -s.send(data); > +sender.send(output); > } catch (Exception ex) { > log.error("Unable to send colllected load information: " + > ex); > -s.close(); > -s = null; > } > } > } > > Added: tomcat/trunk/java/org/apache/catalina/ha/backend/MultiCastSender.java > URL: > http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ha/backend/MultiCastSender.java?rev=763635&view=auto > > == > --- tomcat/trunk/java/org/apache/catalina/ha/backend/MultiCastSender.java > (added) > +++ tomcat/trunk/java/org/apache/catalina/ha/backend/MultiCastSender.java > Thu Apr 9 13:00:21 2009 > @@ -0,0 +1,79 @@ > +/* > + * Licensed to the Apache Software Foundation (ASF) under one or more > + * contributor license agreements. See the NOTICE file distributed with > + * this work for additional information regarding copyright ownership. > + * The ASF licenses this file to You under the Apache License, Version 2.0 > + * (the "License"); you may not use this file except in compliance with > + * the License. You may obtain a copy of the License at > + * > + * http://www.apache.org/licenses/LICENSE-2.0 > + * > + * Unless required by applicable law or agreed to in writing, software > + * distributed under the License is distributed on an "AS IS" BASIS, > + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > + * See the License for the specific language governing permissions and > + * limitations under the License. > + */ > + > + > +package org.apache.catalina.ha.backend; > + > +import org.apache.juli.logging.Log; > +import org.apache.juli.logging.LogFactory; > + > +import java.net.MulticastSocket; > +import java.net.InetAddress; > +import java.net.DatagramPacket; > +import java.io.UnsupportedEncodingException; > + > +/* > + * Sender to proxies using multicast socket. > + */ > +publi
Re: svn commit: r763298 - in /tomcat/trunk/java/org/apache/catalina: core/StandardContext.java core/StandardHost.java tribes/membership/Membership.java util/InstanceSupport.java util/LifecycleSuppor
On 10/04/2009, Mark Thomas wrote: > Filip Hanik - Dev Lists wrote: > > > I'm generally against this find bugs 'may be bugs' issues. > > is there an actual bug here? > > > Reported bug, no. Bugs uses could hit, yes. Hence why this is in trunk > and not being proposed for backport. > > Are all the syncs necessary? I haven't looked in detail but I suspect > that right now, that most of them are not. As we increase JMX > functionality and have more dynamic configuration then we'll almost > certainly need them so I don't see the harm in getting this right now. I've no idea why this is related to JMX. Synchronization is not only about preventing lost updates, it is also about ensuring proper publication. If thread A writes to a non-volatile variable, thread B is only guaranteed to see the latest copy of the variable if both thread A and thread B use synchronization on the *same* variable. Without synch., thread B may never see the updated variable. Indeed it may see an updated reference but an incomplete object. Most of the time, a synchronized setter/unsynchronized getter will work just fine. However, this does not mean that it will always work. > > Mark > > > > > > Filip > > > > ma...@apache.org wrote: > >> Author: markt > >> Date: Wed Apr 8 16:08:42 2009 > >> New Revision: 763298 > >> > >> URL: http://svn.apache.org/viewvc?rev=763298&view=rev > >> Log: > >> Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=46990 > >> Various sync issues. > >> > >> Modified: > >> tomcat/trunk/java/org/apache/catalina/core/StandardContext.java > >> tomcat/trunk/java/org/apache/catalina/core/StandardHost.java > >> > >> tomcat/trunk/java/org/apache/catalina/tribes/membership/Membership.java > >> tomcat/trunk/java/org/apache/catalina/util/InstanceSupport.java > >> tomcat/trunk/java/org/apache/catalina/util/LifecycleSupport.java > >> > >> Modified: tomcat/trunk/java/org/apache/catalina/core/StandardContext.java > >> URL: > >> > http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardContext.java?rev=763298&r1=763297&r2=763298&view=diff > >> > >> > == > >> > >> --- tomcat/trunk/java/org/apache/catalina/core/StandardContext.java > >> (original) > >> +++ tomcat/trunk/java/org/apache/catalina/core/StandardContext.java > >> Wed Apr 8 16:08:42 2009 > >> @@ -201,6 +201,8 @@ > >> * application, in the order they were encountered in the web.xml > >> file. > >> */ > >> private String applicationListeners[] = new String[0]; > >> ++private final Object applicationListenersLock = new Object(); > >> > >> > >> /** > >> @@ -223,6 +225,8 @@ > >> private ApplicationParameter applicationParameters[] = > >> new ApplicationParameter[0]; > >> > >> +private final Object applicationParametersLock = new Object(); > >> + > >> /** > >> * The application available flag for this Context. > >> @@ -263,6 +267,8 @@ > >> * The security constraints for this web application. > >> */ > >> private SecurityConstraint constraints[] = new > >> SecurityConstraint[0]; > >> ++private final Object constraintsLock = new Object(); > >> > >> > >> /** > >> @@ -364,6 +370,9 @@ > >> * defined in the deployment descriptor. > >> */ > >> private FilterMap filterMaps[] = new FilterMap[0]; > >> ++private final Object filterMapsLock = new Object(); > >> + > >> > >> /** > >> * Filter mappings added via {...@link ServletContext} may have to > >> be inserted > >> @@ -388,6 +397,8 @@ > >> */ > >> private String instanceListeners[] = new String[0]; > >> > >> +private final Object instanceListenersLock = new Object(); > >> + > >> > >> /** > >> * The login configuration descriptor for this web application. > >> @@ -508,6 +519,8 @@ > >> */ > >> private String securityRoles[] = new String[0]; > >> > >> +private final Object securityRolesLock = new Object(); > >> + > >> > >> /** > >> * The servlet mappings for this web application, keyed by > >> @@ -515,6 +528,8 @@ > >> */ > >> private HashMap servletMappings = > >> new HashMap(); > >> ++private final Object servletMappingsLock = new Object(); > >> > >> > >> /** > >> @@ -559,12 +574,16 @@ > >> */ > >> private String watchedResources[] = new String[0]; > >> > >> +private final Object watchedResourcesLock = new Object(); > >> + > >> > >> /** > >> * The welcome files for this application. > >> */ > >> private String welcomeFiles[] = new String[0]; > >> > >> +private final Object welcomeFilesLock = new Object(); > >> + > >> > >> /** > >> * The set of classnames of LifecycleListeners that will be added > >> @@ -572,6 +591,7 @@ > >> */ > >>
Re: svn commit: r763726 - in /tomcat/trunk/java/org/apache/catalina/ha/backend: HeartbeatListener.java MultiCastSender.java Proxy.java Sender.java TcpSender.java
On 09/04/2009, jfcl...@apache.org wrote: > Author: jfclere > Date: Thu Apr 9 16:32:04 2009 > New Revision: 763726 > > URL: http://svn.apache.org/viewvc?rev=763726&view=rev > Log: > Add the Tcp code... Still need the code in httpd-trunk to test it. > > Added: > tomcat/trunk/java/org/apache/catalina/ha/backend/Proxy.java > tomcat/trunk/java/org/apache/catalina/ha/backend/TcpSender.java Should add SVN property svn:eol-style=native for such files... > Modified: > tomcat/trunk/java/org/apache/catalina/ha/backend/HeartbeatListener.java > tomcat/trunk/java/org/apache/catalina/ha/backend/MultiCastSender.java > tomcat/trunk/java/org/apache/catalina/ha/backend/Sender.java > > Modified: > tomcat/trunk/java/org/apache/catalina/ha/backend/HeartbeatListener.java > URL: > http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ha/backend/HeartbeatListener.java?rev=763726&r1=763725&r2=763726&view=diff > > == > --- tomcat/trunk/java/org/apache/catalina/ha/backend/HeartbeatListener.java > (original) > +++ tomcat/trunk/java/org/apache/catalina/ha/backend/HeartbeatListener.java > Thu Apr 9 16:32:04 2009 > @@ -29,11 +29,6 @@ > > import org.apache.catalina.connector.Connector; > > -import java.net.MulticastSocket; > -import java.net.InetAddress; > -import java.net.DatagramPacket; > -import java.io.UnsupportedEncodingException; > - > import org.apache.tomcat.util.modeler.Registry; > > /* > @@ -66,6 +61,20 @@ > public void setTtl(int ttl) { this.ttl = ttl; } > public int getTtl() { return ttl; } > > +/** > + * Proxy list, format "address:port,address:port". > + */ > +protected String proxyList = null; > +public String getProxyList() { return proxyList; } > +public void setProxyList(String proxyList) { this.proxyList = > proxyList; } > + > +/** > + * URL prefix. > + */ > +protected String proxyURL = "/HeartbeatListener"; > +public String getProxyURL() { return proxyURL; } > +public void setProxyURL(String proxyURL) { this.proxyURL = proxyURL; } > + > private CollectedInfo coll = null; > > private Sender sender = null; > @@ -77,8 +86,18 @@ > Object source = event.getLifecycle(); > if (Lifecycle.PERIODIC_EVENT.equals(event.getType())) { > if (sender == null) { > -sender = new MultiCastSender(); > -sender.init(this); > +if (proxyList == null) > +sender = new MultiCastSender(); > +else > +sender = new TcpSender(); > + > +try { > +sender.init(this); > +} catch (Exception ex) { > +log.error("Unable to initialize Sender: " + ex); > +sender = null; > +return; > +} > } > > /* Read busy and ready */ > > Modified: > tomcat/trunk/java/org/apache/catalina/ha/backend/MultiCastSender.java > URL: > http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ha/backend/MultiCastSender.java?rev=763726&r1=763725&r2=763726&view=diff > > == > --- tomcat/trunk/java/org/apache/catalina/ha/backend/MultiCastSender.java > (original) > +++ tomcat/trunk/java/org/apache/catalina/ha/backend/MultiCastSender.java > Thu Apr 9 16:32:04 2009 > @@ -40,7 +40,7 @@ > MulticastSocket s = null; > InetAddress group = null; > > -public void init(HeartbeatListener config) { > +public void init(HeartbeatListener config) throws Exception { > this.config = config; > } > > > Added: tomcat/trunk/java/org/apache/catalina/ha/backend/Proxy.java > URL: > http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ha/backend/Proxy.java?rev=763726&view=auto > > == > --- tomcat/trunk/java/org/apache/catalina/ha/backend/Proxy.java (added) > +++ tomcat/trunk/java/org/apache/catalina/ha/backend/Proxy.java Thu Apr 9 > 16:32:04 2009 > @@ -0,0 +1,34 @@ > +/* > + * Licensed to the Apache Software Foundation (ASF) under one or more > + * contributor license agreements. See the NOTICE file distributed with > + * this work for additional information regarding copyright ownership. > + * The ASF licenses this file to You under the Apache License, Version 2.0 > + * (the "License"); you may not use this file except in compliance with > + * the License. You may obtain a copy of the License at > + * > + * http://www.apache.org/licenses/LICENSE-2.0 > + * > + * Unless required by applicable law or agreed to in writing, software > + * distributed under the License is distributed on an "AS IS" BASIS, > + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIN
Problem with ISAPI Redirector
I posted this a couple of days ago on tomcat-user but did not get any response. I'm having a problem using the ISAPI redirector. I making the request, and I get back a 400 Bad Request response. I've gone through the troubleshooting doc, and the howto for the redirector and come up blank. I've also searched the net for the issue. I'm using version 1.2.27 of the ISAPI redirector (but 1.2.28 does the same thing) and Apache Tomcat 5.5.27. Using the IIS administration program, I created a jakarta virtual directory and made it executable. The path points to the directory containing the isapi_redirect.dll. Added the isapi_redirect.dll to the ISAPI Filters for the desired virtual host. Added the isapi_redirect.dll to the list of allowed web extensions. I'm not getting a Green Up-Arrow on the ISAPI redirect filters page. I've done the following: Made the appropriate registry entries. I'm able to get the log file, so I'm confident the registry entries are good. Set the permissions so that the user the web service runs as has read permissions to the configuration directories and write permissions to the log directory. Created the workers.properties: worker.list=ajp13 worker.ajp13.type=ajp13 worker.ajp13.host=localhost worker.ajp13.port=8010 Created the uriworkermap.properties: /calendar/*=ajp13 Configured the server.xml: I've set the level for the isapi log file to debug. When I make a request for the page: http://www.heard.org/calendar/ I get the following log output: http://www.mhsoftware.com/~gsexton/isapi_redirect.log You can see that it's finding the configuration files, and it's mapping the request into the worker but I'm getting a 400 bad request. About the only thing I notice is that the server has multiple application pools set up. At this point I'm stumped. Does anyone have any ideas on what I can try next? -- George Sexton MH Software, Inc. Voice: +1 303 438 9585 URL: http://www.mhsoftware.com/ - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
compile tomcat on windows environment ?
hello all, must i have cygwin to compile tomcat on windows environment ?? since i have exception with "ant download" command when download JDT. thanks Anas _ More than messages–check out the rest of the Windows Live™. http://www.microsoft.com/windows/windowslive/