See this conversation for more background: http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2624522
<http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2624522>I don't think the current default is particularly good -- I think the default should be what you get with Executors.newCachedThreadPool() -- and even though though the API for configuration is pretty rich, I still wish there were a simple way to say "Just use this ExecutorService". --tim On Tue, Oct 12, 2010 at 4:43 PM, Alejandro Raiczyk <[email protected]>wrote: > I'm running my app in production and I'm having the same issue. It > seems that the server threads at some point hungs forever. > > I did a kill -QUIT and magically (or casually) it started accepting > connections again. I'm attatching a part of the output of the thread > dumps, if you need more information just let me know. > > One more thing, when the server hungs, the clients are not able to > send data to the server anymore, neither if I restart the server. I > have to restart the client to get it back to work. > > Here is how I use the client: > > ServerResourceResponse response = service.store(request); > > public ServerResourceResponse store(TracesPostRequest arg0) { > return getTracerService().store(arg0); > } > private TracesService getTracerService() { > // if (service == null) > service = ClientResource.create(this.url, > TracesService.class); > return service; > } > > As you can see, I'm creating an instance for every call. I've tried to > reuse the service instance, but I couldn't because as I read a while a > ago, the instance is not multithreaded. If there's a better way to use > it, please let me know also. > > Regards, > > Alejandro > > 2010/10/12 Daniele Dellafiore <[email protected]>: > > I add that I do not know how to set the maxThreads parameter > > configuring the application with spring. > > In fact this page: > > > > > http://wiki.restlet.org/docs_2.0/13-restlet/28-restlet/70-restlet/196-restlet.html?layoutType=plain > > > > does not declare the context in spring and the ServerResource.init > > method is final in the actual implementation, so I do not know how to > > access the context instance. > > > > On Tue, Oct 12, 2010 at 4:41 PM, Daniele Dellafiore <[email protected]> > wrote: > >> Hi, > >> > >> > >> I got the > >> INFO: Stop accepting new connections and transactions. Consider > >> increasing the maximum number of threads. > >> > >> using restlet 2.0.1 and the server stopped receiving connection. > >> (should not this be a warning?) > >> I googled it and worked around with > >> > >> server.getContext().getParameters().add("maxThreads", "512"); > >> > >> But this is not a solution, just a temporary patch cause I can't > >> understand why 10 connections are not enough in test environment, > >> given that each tests invoke the server, always the same instance, and > >> then I expect the thread to be released so the test that follows can > >> reuse the old thread, given I do not perform simultaneous tests.. > >> > >> Why the thread is not reused? How can I investigate about this > policy/behavior? > >> > >> Maybe you can point me to some article or page in Restlet in Action > >> MEAP which I own. > >> > >> Thanks in advance. > >> > >> -- > >> Daniele Dellafiore > >> http://danieledellafiore.net > >> > > > > > > > > -- > > Daniele Dellafiore > > http://danieledellafiore.net > > > > ------------------------------------------------------ > > > http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2670838 > > > > > > -- > Alejandro Damián Raiczyk > > ------------------------------------------------------ > > http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2670940 ------------------------------------------------------ http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2670948

