jrshow / javamelody

Automatically exported from code.google.com/p/javamelody
0 stars 0 forks source link

Collector server cannot reconnect to disconnected app #323

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
After collector server gets disconnected from monitored application (Due to 
shutdown of this app), it cannot reconnect when both server and app are up 
again. 

Here's stacktrace:

08:57:47,131 WARN  [javamelody] 
java.io.EOFException
    at java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2596)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1316)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)
    at java.util.ArrayList.readObject(ArrayList.java:733)
    at sun.reflect.GeneratedMethodAccessor31.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1017)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1891)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1796)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)
    at net.bull.javamelody.TransportFormat.readSerializableFrom(TransportFormat.java:238)
    at net.bull.javamelody.LabradorRetriever.read(LabradorRetriever.java:302)
    at net.bull.javamelody.LabradorRetriever.call(LabradorRetriever.java:161)
    at net.bull.javamelody.RemoteCollector.collectForUrl(RemoteCollector.java:391)
    at net.bull.javamelody.RemoteCollector.collectDataWithUrls(RemoteCollector.java:96)
    at net.bull.javamelody.RemoteCollector.collectData(RemoteCollector.java:78)
    at net.bull.javamelody.CollectorServer.collectForApplication(CollectorServer.java:165)
    at net.bull.javamelody.CollectorServer.collectForApplication(CollectorServer.java:139)
    at net.bull.javamelody.CollectorServer$2.run(CollectorServer.java:113)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:724)

Original issue reported on code.google.com by tomasz.r...@gmail.com on 19 Jul 2013 at 7:01

GoogleCodeExporter commented 9 years ago
I do not reproduce the issue.
I have warnings in the logs of the collector server when my webapp is 
unavailable, but it reconnects when the webapp is up again.

Do you still have a problem now?

Original comment by evernat@free.fr on 20 Jul 2013 at 5:22

GoogleCodeExporter commented 9 years ago
I've investigated problem a bit further, and connection problem occurs when 
client machine has resource exhaustion (lots of OutOfMemoryErrors), so I guess 
it's the client problem.

Original comment by tomasz.r...@gmail.com on 23 Jul 2013 at 6:49

GoogleCodeExporter commented 9 years ago
In revision 3442 (included in javamelody 1.46 release), I have changed the code 
to also catch Errors (like OOME) in the monitored webapp and to send them to 
the collector server like other exceptions.
So OOME in the monitored webapp will certainly be displayed in the collector 
server. It will be better than displaying the EOFException without the cause.

Thanks.

Original comment by evernat@free.fr on 9 Aug 2013 at 12:34