tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konstantin Kolinko <knst.koli...@gmail.com>
Subject Re: svn commit: r1041120 - in /tomcat/trunk: java/org/apache/catalina/connector/ java/org/apache/coyote/ java/org/apache/coyote/ajp/ java/org/apache/coyote/http11/ java/org/apache/tomcat/util/net/ test/org/apache/tomcat/util/net/ webapps/docs/
Date Fri, 03 Dec 2010 06:43:27 GMT
2010/12/3 Mladen Turk <mturk@apache.org>:
> On 12/01/2010 07:37 PM, markt@apache.org wrote:
>>
>> Author: markt
>> Date: Wed Dec  1 18:37:29 2010
>> New Revision: 1041120
>>
>> URL: http://svn.apache.org/viewvc?rev=1041120&view=rev
>> Log:
>> Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=50360
>> Bind/release socket on start()/stop()
>> Register/deregister MBeans on init()/destroy()
>>
>
>
>>
>> Modified:
>> tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java
>> URL:
>> http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java?rev=1041120&r1=1041119&r2=1041120&view=diff
>>
>> ==============================================================================
>> --- tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java
>> (original)
>> +++ tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java Wed
>> Dec  1 18:37:29 2010
>> @@ -128,11 +128,6 @@ public abstract class AbstractEndpoint {
>>      protected volatile boolean paused = false;
>>
>>      /**
>> -     * Track the initialization state of the endpoint.
>> -     */
>> -    protected boolean initialized = false;
>> -
>
>
> We would need that back or even better axe running and paused
> and creating an "state" enum.
>
> For example the connector will report as running on start()
> even if missconfigured cause it is set before Acceptor or Pollers
> are created.
>
> So internally both for paused and running we actually have
> pauseStarted -> paused, runningStarted -> running=true
> For stop() we have
> pausePending -> paused, runningPending -> running=false
>
> Currently it is possible to start() while stop() is still running
> which could only happen if stop() actually ended.
>
> Think that single eg. EndpointState enum will cover all the
> states during start(),pause(),resume(),stop() replacing multiple
> booleans (at least running and paused) with a single enum.
>
>
> WDTYT?
>

It makes sense for me. Though those booleans are checked here and
there inside loops. I wonder how those checks will be converted to
enums.


I have another question about this commit:
(I have not verified this, just a hunch)

My understanding is that when Tomcat is started by jsvc,
Bootstrap.init(String[]) is called and then jsvc drops privileges and
calls Bootstrap.start(), as documented in [1].

So, binding to port 80 should be performed during initialization while
we have the root privileges, and not during startup. Does binding to
port 80 still work with Tomcat 7?

[1] http://commons.apache.org/daemon/jsvc.html#Directly

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message