Attached are the diffs necessary to fix this.
Jerome Dochez wrote:
> great thanks Justin
>
> I think we should also fix it in the preview branch too , can you send
> me the diffs.
>
> thanks, jerome
>
> Justin Lee wrote:
>> I check in a fix for this to the trunk this morning.
>>
>> Jerome Dochez wrote:
>>> I agree. do we have someone working on this already ?
>>>
>>> On May 11, 2009, at 5:30 PM, Jeanfrancois Arcand wrote:
>>>
>>>>
>>>>
>>>> Amy Roh wrote:
>>>>> Kedar Mhaswade wrote:
>>>>>> Ah. Thanks for the update. Yes, admin-listener should not
>>>>>> by dynamically reconfigurable for now.
>>>>>>
>>>>>> But I thought QL should have caught this. No?
>>>>> The tests aren't trying to dynamically reconfigure
>>>>> admin-listener. The tests are trying to dynamically reconfigure
>>>>> server-config.network-config.transports.transport.tcp in order to
>>>>> make sure it works as expected.
>>>>> I wouldn't think QL has transport.tcp tests?
>>>>> After ClosedChannelException, asadmin is pretty useless returning
>>>>> 404 for all subsequent calls.
>>>>
>>>> I think that needs to be fixed in Admin/AdminAdapter, e.g if the
>>>> connection gets closed by whatever events, admin should be able to
>>>> reconnect. The current situation happens because the listeners get
>>>> turned off then on again, and all connections needs to be closed
>>>> during the reconfiguration.
>>>>
>>>> A+
>>>>
>>>> -- Jeanfrancois
>>>>
>>>>
>>>>> Amy
>>>>>> -Kedar
>>>>>>
>>>>>>
>>>>>> Amy Roh wrote:
>>>>>>> Kedar Mhaswade wrote:
>>>>>>>> Do you randomly get this error on any command?
>>>>>>>>
>>>>>>>> Have you started getting this recently? Is it possible for you
>>>>>>>> to run the
>>>>>>>> devtests with a previous build (like b48)?
>>>>>>>
>>>>>>> Hudson started reporting this today. I was able to isolate the
>>>>>>> issue. It seems that new issue was introduced where dynamic
>>>>>>> reconfiguration for
>>>>>>> configs.config.server-config.network-config.transports.transport.tcp.acceptor-threads
>>>>>>> is causing ClosedChannelException at AdminAdapter.service -
>>>>>>> which caused 404. I've filed 8287.
>>>>>>>
>>>>>>> asadmin set
>>>>>>> configs.config.server-config.network-config.transports.transport.tcp.acceptor-threads=5
>>>>>>>
>>>>>>> Remote server does not listen for requests on [localhost:4848].
>>>>>>> Is the server up?
>>>>>>> No such local command, set. To run remote commands, start the
>>>>>>> application server (e.g. asadmin start-domain).
>>>>>>> Command set failed.
>>>>>>>
>>>>>>> [#|2009-05-11T13:23:08.492-0700|SEVERE|glassfish|com.sun.grizzly.config.GrizzlyServiceListener|_ThreadID=17;_ThreadName=Thread-1;|service
>>>>>>> exception
>>>>>>> java.lang.RuntimeException: ClientAbortException:
>>>>>>> java.nio.channels.ClosedChannelException
>>>>>>> at
>>>>>>> com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:212)
>>>>>>>
>>>>>>> at
>>>>>>> com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:165)
>>>>>>>
>>>>>>>
>>>>>>> Caused by: ClientAbortException:
>>>>>>> java.nio.channels.ClosedChannelException
>>>>>>> at
>>>>>>> com.sun.grizzly.tcp.http11.GrizzlyOutputBuffer.doFlush(GrizzlyOutputBuffer.java:436)
>>>>>>>
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Amy
>>>>>>>
>>>>>>>>
>>>>>>>> -Kedar
>>>>>>>>
>>>>>>>>
>>>>>>>> Amy Roh wrote:
>>>>>>>>> I am noticing 404 status returning from asadmin commands from
>>>>>>>>> web devtest on Hudson. What could be causing these 404s from
>>>>>>>>> asadmin? It seems the server is still running and is available.
>>>>>>>>>
>>>>>>>>> asadmin-common-ignore-fail:
>>>>>>>>> [echo] asadmin set --user anonymous --passwordfile
>>>>>>>>> /files/hudson/workspace/webtier-dev-tests-v3/appserv-tests/config/adminpassword.txt
>>>>>>>>> --host localhost --port 34182 --echo=true --terse=true
>>>>>>>>> configs.config.server-config.network-config.protocols.protocol.http-listener-2.http.timeout-seconds=0
>>>>>>>>>
>>>>>>>>> [exec] set --echo=true --terse=true --port=34182
>>>>>>>>> --host=localhost
>>>>>>>>> --passwordfile=/files/hudson/workspace/webtier-dev-tests-v3/appserv-tests/config/adminpassword.txt
>>>>>>>>> --user=anonymous
>>>>>>>>> configs.config.server-config.network-config.protocols.protocol.http-listener-2.http.timeout-seconds=0
>>>>>>>>>
>>>>>>>>> [exec] Status: 404
>>>>>>>>> [exec] Result: 1
>>>>>>>>>
>>>>>>>>> stopDomain:
>>>>>>>>> [echo] run.xml:stopping domain...
>>>>>>>>> [exec] com.sun.enterprise.cli.framework.CommandException:
>>>>>>>>> Status: 404
>>>>>>>>> [exec] Command stop-domain failed.
>>>>>>>>>
>>>>>>>>> Thanks,
>>>>>>>>> Amy
>>>>>>>>>
>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>
>>>>>>>>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>>>>>>>>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>>>>>>>>
>>>>>>>>
>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>
>>>>>>>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>>>>>>>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>>
>>>>>>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>>>>>>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>>
>>>>>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>>>>>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>>>>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>>>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>
Index: ../web/web-glue/src/main/java/com/sun/enterprise/web/reconfig/HttpServiceConfigListener.java
===================================================================
--- ../web/web-glue/src/main/java/com/sun/enterprise/web/reconfig/HttpServiceConfigListener.java (revision 27232)
+++ ../web/web-glue/src/main/java/com/sun/enterprise/web/reconfig/HttpServiceConfigListener.java (revision 27233)
@@ -107,7 +107,7 @@
return ConfigSupport.sortAndDispatch(events, new Changed() {
public <T extends ConfigBeanProxy> NotProcessed changed(TYPE type, Class<T> tClass, T t) {
if (logger.isLoggable(Level.FINE)) {
- logger.fine("HttpService config changed "+type+" "+tClass+" "+t);
+ logger.fine("Network config changed "+type+" "+tClass+" "+t);
}
try {
if (t instanceof VirtualServer) {
Index: ../pom.xml
===================================================================
--- ../pom.xml (revision 27232)
+++ ../pom.xml (revision 27233)
@@ -110,7 +110,7 @@
<deployment-api.version>1.2-rev-1</deployment-api.version>
<jaxrpc-api.version>1.1</jaxrpc-api.version>
<grizzly.version>1.9.15</grizzly.version>
- <grizzly-config.version>1.0.7</grizzly-config.version>
+ <grizzly-config.version>1.0.8</grizzly-config.version>
<jaxb-api.version>2.1</jaxb-api.version>
<jaxws-api.version>2.1</jaxws-api.version>
<jsr250-api.version>1.0</jsr250-api.version>
Index: ../core/kernel/src/main/java/com/sun/enterprise/v3/services/impl/GrizzlyProxy.java
===================================================================
--- ../core/kernel/src/main/java/com/sun/enterprise/v3/services/impl/GrizzlyProxy.java (revision 27232)
+++ ../core/kernel/src/main/java/com/sun/enterprise/v3/services/impl/GrizzlyProxy.java (revision 27233)
@@ -22,19 +22,6 @@
*/
package com.sun.enterprise.v3.services.impl;
-import java.io.IOException;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.Future;
-import java.util.concurrent.TimeUnit;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import com.sun.enterprise.config.serverbeans.HttpService;
import com.sun.enterprise.util.Result;
import com.sun.enterprise.v3.admin.AdminAdapter;
import com.sun.enterprise.v3.admin.adapter.AdminConsoleAdapter;
@@ -51,6 +38,18 @@
import org.glassfish.internal.grizzly.V3Mapper;
import org.jvnet.hk2.component.Inhabitant;
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
/**
* The Grizzly Service is responsible for starting Grizzly Port Unification
* mechanism. It is also providing a runtime service where other services (like
Index: ../core/kernel/src/main/java/com/sun/enterprise/v3/services/impl/GrizzlyService.java
===================================================================
--- ../core/kernel/src/main/java/com/sun/enterprise/v3/services/impl/GrizzlyService.java (revision 27232)
+++ ../core/kernel/src/main/java/com/sun/enterprise/v3/services/impl/GrizzlyService.java (revision 27233)
@@ -44,6 +44,7 @@
import com.sun.grizzly.config.dom.NetworkConfig;
import com.sun.grizzly.config.dom.NetworkListener;
import com.sun.grizzly.config.dom.NetworkListeners;
+import com.sun.grizzly.config.dom.Protocol;
import com.sun.grizzly.tcp.Adapter;
import com.sun.grizzly.util.http.mapper.Mapper;
import com.sun.hk2.component.ConstructorWomb;
@@ -63,6 +64,7 @@
import org.jvnet.hk2.component.Singleton;
import org.jvnet.hk2.config.ConfigSupport;
import org.jvnet.hk2.config.ObservableBean;
+import org.jvnet.hk2.config.ConfigBeanProxy;
/**
* The Network Service is responsible for starting grizzly and register the
@@ -107,6 +109,8 @@
ConcurrentLinkedQueue<MapperUpdateListener> mapperUpdateListeners =
new ConcurrentLinkedQueue<MapperUpdateListener>();
+ private DynamicConfigListener configListener;
+
public GrizzlyService() {
futures = new ArrayList<Future<Result<Thread>>>();
}
@@ -262,7 +266,7 @@
DynamicConfigListener.class,
habitat,
null);
- DynamicConfigListener configListener = womb.get(null);
+ configListener = womb.get(null);
ObservableBean bean = (ObservableBean) ConfigSupport.getImpl(networkConfig.getNetworkListeners());
bean.addListener(configListener);
@@ -366,13 +370,27 @@
proxies.add(proxy);
futures.add(future);
+ addChangeListener(listener);
+ addChangeListener(listener.findThreadPool());
+ addChangeListener(listener.findTransport());
+ final Protocol protocol = listener.findProtocol();
+ addChangeListener(protocol);
+ addChangeListener(protocol.getHttp());
+ addChangeListener(protocol.getHttp().getFileCache());
+ addChangeListener(protocol.getSsl());
+
return future;
}
-
+
+ private void addChangeListener(ConfigBeanProxy bean) {
+ if(bean != null) {
+ ((ObservableBean) ConfigSupport.getImpl(bean)).addListener(configListener);
+ }
+ }
-
+
/*
- * Registers all proxies
- */
+ * Registers all proxies
+ */
public void registerNetworkProxy() {
registerNetworkProxy(ALL_PORTS);
}
Index: ../core/kernel/src/main/java/com/sun/enterprise/v3/services/impl/DynamicConfigListener.java
===================================================================
--- ../core/kernel/src/main/java/com/sun/enterprise/v3/services/impl/DynamicConfigListener.java (revision 27232)
+++ ../core/kernel/src/main/java/com/sun/enterprise/v3/services/impl/DynamicConfigListener.java (revision 27233)
@@ -25,8 +25,14 @@
import java.beans.PropertyChangeEvent;
import java.util.logging.Level;
import java.util.logging.Logger;
+import java.util.Collection;
import com.sun.grizzly.config.dom.NetworkListener;
+import com.sun.grizzly.config.dom.Http;
+import com.sun.grizzly.config.dom.Protocol;
+import com.sun.grizzly.config.dom.Ssl;
+import com.sun.grizzly.config.dom.ThreadPool;
+import com.sun.grizzly.config.dom.Transport;
import org.jvnet.hk2.config.Changed;
import org.jvnet.hk2.config.ConfigBeanProxy;
import org.jvnet.hk2.config.ConfigListener;
@@ -49,50 +55,74 @@
public UnprocessedChangeEvents changed(PropertyChangeEvent[] events) {
final UnprocessedChangeEvents unp = ConfigSupport.sortAndDispatch(
- events, new Changed() {
+ events, new Changed() {
-
- public <T extends ConfigBeanProxy> NotProcessed changed(TYPE type,
+ public <T extends ConfigBeanProxy> NotProcessed changed(TYPE type,
Class<T> tClass, T t) {
- if (logger.isLoggable(Level.FINE)) {
- logger.log(Level.FINE, "NetworkConfig changed " + type
+ if (logger.isLoggable(Level.FINE)) {
+ logger.log(Level.FINE, "NetworkConfig changed " + type
+ " " + tClass + " " + t);
- }
+ }
-
- if (t instanceof NetworkListener) {
+ if (t instanceof NetworkListener) {
- NetworkListener listener = (NetworkListener) t;
+ return processNetworkListener(type, (NetworkListener) t);
+ } else if (t instanceof Http) {
+ return processProtocol(type, (Protocol) ((Http) t).getParent());
+ } else if (t instanceof Ssl) {
+ return processProtocol(type, (Protocol) ((Ssl) t).getParent());
+ } else if (t instanceof Protocol) {
+ return processProtocol(type, (Protocol) t);
+ } else if (t instanceof ThreadPool) {
+ ThreadPool pool = (ThreadPool) t;
+ NotProcessed notProcessed = null;
+ for (NetworkListener listener : (Collection<NetworkListener>) pool.findNetworkListeners()) {
+ notProcessed = processNetworkListener(type, listener);
+ }
+ return notProcessed;
+ } else if (t instanceof Transport) {
+ Transport transport = (Transport) t;
+ NotProcessed notProcessed = null;
+ for (NetworkListener listener : (Collection<NetworkListener>) transport.findNetworkListeners()) {
+ notProcessed = processNetworkListener(type, listener);
+ }
+ return notProcessed;
+ }
+ return null;
+ }
+ }, logger);
+ return unp;
+ }
+
+ private <T extends ConfigBeanProxy> NotProcessed processNetworkListener(Changed.TYPE type,
+ NetworkListener listener) {
- int listenerPort = -1;
- try {
+ int listenerPort = -1;
+ try {
- listenerPort = Integer.parseInt(
- listener.getPort());
+ listenerPort = Integer.parseInt(listener.getPort());
- } catch (NumberFormatException e) {
+ } catch (NumberFormatException e) {
- logger.log(Level.WARNING,
- "Can not parse network-listener port number: " +
- listener.getPort());
+ logger.log(Level.WARNING, "Can not parse network-listener port number: " + listener.getPort());
- }
+ }
-
- if (type == TYPE.ADD) {
+ if (type == Changed.TYPE.ADD) {
- grizzlyService.createNetworkProxy(listener);
- grizzlyService.registerNetworkProxy(listenerPort);
+ grizzlyService.createNetworkProxy(listener);
+ grizzlyService.registerNetworkProxy(listenerPort);
- } else if (type == TYPE.REMOVE) {
+ } else if (type == Changed.TYPE.REMOVE) {
- grizzlyService.removeNetworkProxy(listenerPort);
+ grizzlyService.removeNetworkProxy(listenerPort);
- } else if (type == TYPE.CHANGE) {
+ } else if (type == Changed.TYPE.CHANGE) {
- // Restart GrizzlyProxy on the port
- // Port number or id could be changed - so try to find
- // corresponding proxy both ways
- boolean isRemovedOld =
- grizzlyService.removeNetworkProxy(listenerPort) ||
- grizzlyService.removeNetworkProxy(listener.getName());
+ // Restart GrizzlyProxy on the port
+ // Port number or id could be changed - so try to find
+ // corresponding proxy both ways
+ boolean isRemovedOld =
+ grizzlyService.removeNetworkProxy(listenerPort) ||
+ grizzlyService.removeNetworkProxy(listener.getName());
-
- grizzlyService.createNetworkProxy(listener);
- grizzlyService.registerNetworkProxy(listenerPort);
- }
- return null;
- }
+ grizzlyService.createNetworkProxy(listener);
+ grizzlyService.registerNetworkProxy(listenerPort);
+ }
+ return null;
+ }
- return null;
+ private NotProcessed processProtocol(Changed.TYPE type, Protocol protocol) {
+ NotProcessed notProcessed = null;
+ for (NetworkListener listener : (Collection<NetworkListener>) protocol.findNetworkListeners()) {
+ notProcessed = processNetworkListener(type, listener);
- }
+ }
- }, logger);
- return unp;
+ return notProcessed;
}
public void setGrizzlyService(GrizzlyService grizzlyService) {
@@ -106,4 +136,4 @@
public void setLogger(Logger logger) {
this.logger = logger;
}
-}
\ No newline at end of file
+}
Index: ../core/kernel/src/main/java/com/sun/enterprise/v3/services/impl/DynamicConfigListener.java
===================================================================
--- ../core/kernel/src/main/java/com/sun/enterprise/v3/services/impl/DynamicConfigListener.java (revision 27259)
+++ ../core/kernel/src/main/java/com/sun/enterprise/v3/services/impl/DynamicConfigListener.java (revision 27260)
@@ -93,27 +93,29 @@
private <T extends ConfigBeanProxy> NotProcessed processNetworkListener(Changed.TYPE type,
NetworkListener listener) {
+ if (!"admin-listener".equals(listener.getName())) {
- int listenerPort = -1;
- try {
- listenerPort = Integer.parseInt(listener.getPort());
- } catch (NumberFormatException e) {
- logger.log(Level.WARNING, "Can not parse network-listener port number: " + listener.getPort());
- }
- if (type == Changed.TYPE.ADD) {
- grizzlyService.createNetworkProxy(listener);
- grizzlyService.registerNetworkProxy(listenerPort);
- } else if (type == Changed.TYPE.REMOVE) {
- grizzlyService.removeNetworkProxy(listenerPort);
- } else if (type == Changed.TYPE.CHANGE) {
- // Restart GrizzlyProxy on the port
- // Port number or id could be changed - so try to find
- // corresponding proxy both ways
- boolean isRemovedOld =
- grizzlyService.removeNetworkProxy(listenerPort) ||
- grizzlyService.removeNetworkProxy(listener.getName());
- grizzlyService.createNetworkProxy(listener);
- grizzlyService.registerNetworkProxy(listenerPort);
- }
+ int listenerPort = -1;
+ try {
+ listenerPort = Integer.parseInt(listener.getPort());
+ } catch (NumberFormatException e) {
+ logger.log(Level.WARNING, "Can not parse network-listener port number: " + listener.getPort());
+ }
+ if (type == Changed.TYPE.ADD) {
+ grizzlyService.createNetworkProxy(listener);
+ grizzlyService.registerNetworkProxy(listenerPort);
+ } else if (type == Changed.TYPE.REMOVE) {
+ grizzlyService.removeNetworkProxy(listenerPort);
+ } else if (type == Changed.TYPE.CHANGE) {
+ // Restart GrizzlyProxy on the port
+ // Port number or id could be changed - so try to find
+ // corresponding proxy both ways
+ boolean isRemovedOld =
+ grizzlyService.removeNetworkProxy(listenerPort) ||
+ grizzlyService.removeNetworkProxy(listener.getName());
+ grizzlyService.createNetworkProxy(listener);
+ grizzlyService.registerNetworkProxy(listenerPort);
+ }
+ }
return null;
}