{"action":"created","issue":{"url":"https://api.github.com/repos/4finance/micro-infra-spring/issues/230","labels_url":"https://api.github.com/repos/4finance/micro-infra-spring/issues/230/labels{/name}","comments_url":"https://api.github.com/repos/4finance/micro-infra-spring/issues/230/comments","events_url":"https://api.github.com/repos/4finance/micro-infra-spring/issues/230/events","html_url":"https://github.com/4finance/micro-infra-spring/issues/230","id":55917222,"number":230,"title":"stub-runner hangs when artifacts reposiotry is not responding","user":{"login":"nurkiewicz","id":164045,"avatar_url":"https://avatars.githubusercontent.com/u/164045?v=3","gravatar_id":"","url":"https://api.github.com/users/nurkiewicz","html_url":"https://github.com/nurkiewicz","followers_url":"https://api.github.com/users/nurkiewicz/followers","following_url":"https://api.github.com/users/nurkiewicz/following{/other_user}","gists_url":"https://api.github.com/users/nurkiewicz/gists{/gist_id}","starred_url":"https://api.github.com/users/nurkiewicz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nurkiewicz/subscriptions","organizations_url":"https://api.github.com/users/nurkiewicz/orgs","repos_url":"https://api.github.com/users/nurkiewicz/repos","events_url":"https://api.github.com/users/nurkiewicz/events{/privacy}","received_events_url":"https://api.github.com/users/nurkiewicz/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/4finance/micro-infra-spring/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-01-29T15:57:35Z","updated_at":"2015-01-29T15:57:37Z","closed_at":null,"body":"<a href=\"https://github.com/szpak\"><img src=\"https://avatars.githubusercontent.com/u/148013?v=3\" align=\"left\" width=\"96\" height=\"96\" hspace=\"10\"></img></a> **Issue by [szpak](https://github.com/szpak)**\n_Friday Dec 19, 2014 at 17:34 GMT_\n_Originally opened as https://github.com/4finance/stub-runner/issues/23_\n\n----\n\nFor example when a server is not accessible without a company VPN. It just hangs for a few minute (possible longer - not tested). In the result the end application startup hangs without any sign what is going on.\r\n\r\nA fragment of the long thread dump:\r\n\r\n```\r\n\"main\" prio=10 tid=0x00007f997c024800 nid=0x3898 runnable [0x00007f9985840000]\r\n   java.lang.Thread.State: RUNNABLE\r\n\tat java.net.PlainSocketImpl.socketConnect(Native Method)\r\n\tat java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)\r\n\t- locked <0x00000000ed538c48> (a java.net.SocksSocketImpl)\r\n\tat java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)\r\n\tat java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)\r\n\tat java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)\r\n\tat java.net.Socket.connect(Socket.java:579)\r\n\tat java.net.Socket.connect(Socket.java:528)\r\n\tat sun.net.NetworkClient.doConnect(NetworkClient.java:180)\r\n\tat sun.net.www.http.HttpClient.openServer(HttpClient.java:432)\r\n\tat sun.net.www.http.HttpClient.openServer(HttpClient.java:527)\r\n\t- locked <0x00000000ed538bc0> (a sun.net.www.http.HttpClient)\r\n\tat sun.net.www.http.HttpClient.<init>(HttpClient.java:211)\r\n\tat sun.net.www.http.HttpClient.New(HttpClient.java:308)\r\n\tat sun.net.www.http.HttpClient.New(HttpClient.java:326)\r\n\tat sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:996)\r\n\tat sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:932)\r\n\tat sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:850)\r\n\tat sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1300)\r\n\t- locked <0x00000000ed538108> (a sun.net.www.protocol.http.HttpURLConnection)\r\n\tat java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:468)\r\n\tat org.apache.ivy.util.url.BasicURLHandler.checkStatusCode(BasicURLHandler.java:130)\r\n\tat org.apache.ivy.util.url.BasicURLHandler.openStream(BasicURLHandler.java:165)\r\n\tat org.apache.ivy.util.url.ApacheURLLister.retrieveListing(ApacheURLLister.java:112)\r\n\tat org.apache.ivy.util.url.ApacheURLLister.listAll(ApacheURLLister.java:57)\r\n\tat org.apache.ivy.plugins.repository.url.URLRepository.list(URLRepository.java:100)\r\n\tat org.apache.ivy.plugins.resolver.util.ResolverHelper.listAll(ResolverHelper.java:108)\r\n\tat org.apache.ivy.plugins.resolver.util.ResolverHelper.listTokenValues(ResolverHelper.java:57)\r\n\tat org.apache.ivy.plugins.resolver.util.ResolverHelper.findAll(ResolverHelper.java:144)\r\n\tat org.apache.ivy.plugins.resolver.RepositoryResolver.listResources(RepositoryResolver.java:185)\r\n\tat org.apache.ivy.plugins.resolver.IBiblioResolver.listResources(IBiblioResolver.java:428)\r\n\tat org.apache.ivy.plugins.resolver.RepositoryResolver.findDynamicResourceUsingPattern(RepositoryResolver.java:149)\r\n\tat org.apache.ivy.plugins.resolver.RepositoryResolver.findResourceUsingPattern(RepositoryResolver.java:132)\r\n\tat org.apache.ivy.plugins.resolver.AbstractPatternsBasedResolver.findResourceUsingPatterns(AbstractPatternsBasedResolver.java:96)\r\n\tat org.apache.ivy.plugins.resolver.IBiblioResolver.findIvyFileRef(IBiblioResolver.java:102)\r\n\tat org.apache.ivy.plugins.resolver.BasicResolver.getDependency(BasicResolver.java:228)\r\n\tat org.apache.ivy.plugins.resolver.IBiblioResolver.getDependency(IBiblioResolver.java:512)\r\n\tat org.apache.ivy.plugins.resolver.ChainResolver.getDependency(ChainResolver.java:104)\r\n\tat org.apache.ivy.core.resolve.IvyNode.loadData(IvyNode.java:169)\r\n\tat org.apache.ivy.core.resolve.VisitNode.loadData(VisitNode.java:292)\r\n\tat org.apache.ivy.core.resolve.ResolveEngine.fetchDependencies(ResolveEngine.java:714)\r\n\tat org.apache.ivy.core.resolve.ResolveEngine.doFetchDependencies(ResolveEngine.java:799)\r\n\tat org.apache.ivy.core.resolve.ResolveEngine.fetchDependencies(ResolveEngine.java:722)\r\n\tat org.apache.ivy.core.resolve.ResolveEngine.getDependencies(ResolveEngine.java:594)\r\n\tat org.apache.ivy.core.resolve.ResolveEngine.resolve(ResolveEngine.java:234)\r\n\tat org.apache.ivy.Ivy.resolve(Ivy.java:517)\r\n\tat org.apache.ivy.Ivy$resolve$0.call(Unknown Source)\r\n\tat org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)\r\n\tat org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)\r\n\tat org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120)\r\n\tat groovy.grape.GrapeIvy.getDependencies(GrapeIvy.groovy:406)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:606)\r\n\tat org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSite.invoke(PogoMetaMethodSite.java:166)\r\n\tat org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:56)\r\n\tat org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49)\r\n\tat org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)\r\n\tat groovy.grape.GrapeIvy.resolve(GrapeIvy.groovy:565)\r\n\tat groovy.grape.GrapeIvy$resolve$2.callCurrent(Unknown Source)\r\n\tat org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49)\r\n\tat org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)\r\n\tat org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:153)\r\n\tat groovy.grape.GrapeIvy.resolve(GrapeIvy.groovy:530)\r\n\tat groovy.grape.Grape.resolve(Grape.java:198)\r\n\tat groovy.grape.Grape.resolve(Grape.java:184)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:606)\r\n\tat org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)\r\n\tat groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)\r\n\tat org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.invoke(StaticMetaMethodSite.java:43)\r\n\tat org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.callStatic(StaticMetaMethodSite.java:99)\r\n\tat org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallStatic(CallSiteArray.java:53)\r\n\tat org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:157)\r\n\tat org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:169)\r\n\tat com.ofg.stub.config.StubRunnerConfiguration$DependencyResolver.resolveDependencyLocation(StubRunnerConfiguration.groovy:211)\r\n\tat com.ofg.stub.config.StubRunnerConfiguration$DependencyResolver$resolveDependencyLocation.callCurrent(Unknown Source)\r\n\tat org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49)\r\n\tat org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)\r\n\tat org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)\r\n\tat com.ofg.stub.config.StubRunnerConfiguration$RemoteDependencyResolver.doResolveRemoteDependency(StubRunnerConfiguration.groovy:163)\r\n\tat com.ofg.stub.config.StubRunnerConfiguration$RemoteDependencyResolver.this$3$doResolveRemoteDependency(StubRunnerConfiguration.groovy)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:606)\r\n\tat org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:207)\r\n\tat org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:56)\r\n\tat org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49)\r\n\tat org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)\r\n\tat org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:145)\r\n\tat com.ofg.stub.config.StubRunnerConfiguration$RemoteDependencyResolver.resolveDependency(StubRunnerConfiguration.groovy:137)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:606)\r\n\tat org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:207)\r\n\tat org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.call(PogoMetaMethodSite.java:68)\r\n\tat org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)\r\n\tat org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)\r\n\tat org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120)\r\n\tat com.ofg.stub.config.StubRunnerConfiguration.findGrabbedStubJars(StubRunnerConfiguration.groovy:111)\r\n\tat com.ofg.stub.config.StubRunnerConfiguration.batchStubRunner(StubRunnerConfiguration.groovy:87)\r\n\tat com.ofg.stub.config.StubRunnerConfiguration$$EnhancerBySpringCGLIB$$36632f68.CGLIB$batchStubRunner$23(<generated>)\r\n\tat com.ofg.stub.config.StubRunnerConfiguration$$EnhancerBySpringCGLIB$$36632f68$$FastClassBySpringCGLIB$$2fb274e.invoke(<generated>)\r\n\tat org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)\r\n\tat org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:312)\r\n\tat com.ofg.stub.config.StubRunnerConfiguration$$EnhancerBySpringCGLIB$$36632f68.batchStubRunner(<generated>)\r\n(...)\r\n```\r\n\n"},"comment":{"url":"https://api.github.com/repos/4finance/micro-infra-spring/issues/comments/72049040","html_url":"https://github.com/4finance/micro-infra-spring/issues/230#issuecomment-72049040","issue_url":"https://api.github.com/repos/4finance/micro-infra-spring/issues/230","id":72049040,"user":{"login":"nurkiewicz","id":164045,"avatar_url":"https://avatars.githubusercontent.com/u/164045?v=3","gravatar_id":"","url":"https://api.github.com/users/nurkiewicz","html_url":"https://github.com/nurkiewicz","followers_url":"https://api.github.com/users/nurkiewicz/followers","following_url":"https://api.github.com/users/nurkiewicz/following{/other_user}","gists_url":"https://api.github.com/users/nurkiewicz/gists{/gist_id}","starred_url":"https://api.github.com/users/nurkiewicz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nurkiewicz/subscriptions","organizations_url":"https://api.github.com/users/nurkiewicz/orgs","repos_url":"https://api.github.com/users/nurkiewicz/repos","events_url":"https://api.github.com/users/nurkiewicz/events{/privacy}","received_events_url":"https://api.github.com/users/nurkiewicz/received_events","type":"User","site_admin":false},"created_at":"2015-01-29T15:57:37Z","updated_at":"2015-01-29T15:57:37Z","body":"<a href=\"https://github.com/nurkiewicz\"><img src=\"https://avatars.githubusercontent.com/u/164045?v=3\" align=\"left\" width=\"48\" height=\"48\" hspace=\"10\"></img></a> **Comment by [nurkiewicz](https://github.com/nurkiewicz)**\n_Thursday Jan 08, 2015 at 20:31 GMT_\n\n----\n\nLet's make it even more insane. I suggest starting in-memory ZooKeeper first, but move downloading stubs and starting WireMock servers into a background thread. This way we don't slow down application startup and after all, application shouldn't assume all dependencies are available right from the beginning.\r\n\r\nOf course there is a problem with error handling. Should we ignore problems while downloading stubs (timeouts, other exceptions) or shut down application in some unexpected moment?\n"}}