wisdom-framework / wisdom

A modular and dynamic web framework
http://wisdom-framework.org
Apache License 2.0
88 stars 42 forks source link

Exception in router makes Wisdom a Zombie #544

Closed magnet closed 8 years ago

magnet commented 8 years ago

The following exception sometimes happens when we run Wisdom, and it leaves the router in an unhealthy state in which all requests return 503 or close the socket early.

02/12/15 17:18:02 (G) LoggerService.log : [ERROR]  : The method bindFilter in the implementation class org.wisdom.router.RequestRouter throws an exception : null
java.util.ConcurrentModificationException
        at java.util.ArrayList.sort(ArrayList.java:1456)
        at java.util.Collections.sort(Collections.java:175)
        at org.wisdom.router.RequestRouter$FilterSet.__M_add(RequestRouter.java:481)
        at org.wisdom.router.RequestRouter$FilterSet.add(RequestRouter.java)
        at org.wisdom.router.RequestRouter$FilterSet.__M_add(RequestRouter.java:475)
        at org.wisdom.router.RequestRouter$FilterSet.add(RequestRouter.java)
        at org.wisdom.router.RequestRouter.__M_bindFilter(RequestRouter.java:429)
        at org.wisdom.router.RequestRouter.bindFilter(RequestRouter.java)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
magnet commented 8 years ago

Another similar one, same effect:

03/12/15 11:52:30 (G) LoggerService.log : [ERROR]  : The method unbindFilter in the implementation class org.wisdom.router.RequestRouter throws an exception : null
java.lang.NullPointerException
        at org.wisdom.router.RequestRouter$FilterSet.__M_indexOf(RequestRouter.java:501)
        at org.wisdom.router.RequestRouter$FilterSet.indexOf(RequestRouter.java)
        at org.wisdom.router.RequestRouter$FilterSet.__M_remove(RequestRouter.java:510)
        at org.wisdom.router.RequestRouter$FilterSet.remove(RequestRouter.java)
        at org.wisdom.router.RequestRouter.__M_unbindFilter(RequestRouter.java:439)
        at org.wisdom.router.RequestRouter.unbindFilter(RequestRouter.java)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.apache.felix.ipojo.util.Callback.call(Callback.java:237)
        at org.apache.felix.ipojo.handlers.dependency.DependencyCallback.call(DependencyCallback.java:232)
        at org.apache.felix.ipojo.handlers.dependency.Dependency.invokeCallback(Dependency.java:338)
        at org.apache.felix.ipojo.handlers.dependency.Dependency.callUnbindMethod(Dependency.java:321)
        at org.apache.felix.ipojo.handlers.dependency.Dependency.onServiceDeparture(Dependency.java:569)
        at org.apache.felix.ipojo.util.DependencyModel.onChange(DependencyModel.java:1094)
        at org.apache.felix.ipojo.dependency.impl.ServiceReferenceManager.fireUpdate(ServiceReferenceManager.java:561)
        at org.apache.felix.ipojo.dependency.impl.ServiceReferenceManager.onDepartureOfAMatchingService(ServiceReferenceManager.java:672)
        at org.apache.felix.ipojo.dependency.impl.ServiceReferenceManager.removedService(ServiceReferenceManager.java:687)
cescoffier commented 8 years ago

Hi,

Definitely a rece condition in the router. Which version are you using ?

On 3 déc. 2015, at 14:18, Simon Chemouil notifications@github.com wrote:

Another similar one, same effect:

03/12/15 11:52:30 (G) LoggerService.log : [ERROR] : The method unbindFilter in the implementation class org.wisdom.router.RequestRouter throws an exception : null java.lang.NullPointerException at org.wisdom.router.RequestRouter$FilterSet.M_indexOf(RequestRouter.java:501) at org.wisdom.router.RequestRouter$FilterSet.indexOf(RequestRouter.java) at org.wisdom.router.RequestRouter$FilterSet.__M_remove(RequestRouter.java:510) at org.wisdom.router.RequestRouter$FilterSet.remove(RequestRouter.java) at org.wisdom.router.RequestRouter.M_unbindFilter(RequestRouter.java:439) at org.wisdom.router.RequestRouter.unbindFilter(RequestRouter.java) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.apache.felix.ipojo.util.Callback.call(Callback.java:237) at org.apache.felix.ipojo.handlers.dependency.DependencyCallback.call(DependencyCallback.java:232) at org.apache.felix.ipojo.handlers.dependency.Dependency.invokeCallback(Dependency.java:338) at org.apache.felix.ipojo.handlers.dependency.Dependency.callUnbindMethod(Dependency.java:321) at org.apache.felix.ipojo.handlers.dependency.Dependency.onServiceDeparture(Dependency.java:569) at org.apache.felix.ipojo.util.DependencyModel.onChange(DependencyModel.java:1094) at org.apache.felix.ipojo.dependency.impl.ServiceReferenceManager.fireUpdate(ServiceReferenceManager.java:561) at org.apache.felix.ipojo.dependency.impl.ServiceReferenceManager.onDepartureOfAMatchingService(ServiceReferenceManager.java:672) at org.apache.felix.ipojo.dependency.impl.ServiceReferenceManager.removedService(ServiceReferenceManager.java:687) — Reply to this email directly or view it on GitHub https://github.com/wisdom-framework/wisdom/issues/544#issuecomment-161636205.

magnet commented 8 years ago

I'm on 0.9.1

cescoffier commented 8 years ago

It's all related to filters (I was afraid it was the routes).