Archived

This forum has been archived. Please start a new discussion on GitHub.

thread syscall exception:

xdm
xdm La Coruña, Spain
I testing a simple servant it's implementation is as follow, when i make a lot of concurrent request to this servant (2 per second) during 1 minute
i get a exception that is show at the end of this post


Servant implementation
Oz::Web::WebResponse 
Oz::Web::WebApplicationManagerI::processRequest(
	const Oz::Web::WebRequest& request,
	const Ice::Current& current)
{
	IceUtil::RWRecMutex::WLock sync(*this);
	Oz::Web::WebResponse response;	
	response.response="<h2>Response OK</h2>";
	return response;
}

C++ exception in client side
error: cannot create thread for `Ice.ThreadPool.Client':
Thread.cpp:551: IceUtil::ThreadSyscallException:
thread syscall exception: Resource temporarily unavailable
error: cannot create thread pool for connection:
Thread.cpp:551: IceUtil::ThreadSyscallException:
thread syscall exception: Resource temporarily unavailable

I prove this whit diferent thread pool size for server and client but later or sooner i always get the same error.

Server threadPool config
<property name="Ice.ThreadPool.Server.Size" value="10"/>
<property name="Ice.ThreadPool.Server.SizeMax" value="10"/>

Client threadPool config
Ice::PropertiesPtr properties=Ice::createProperties();
	properties->setProperty(
		"Ice.Default.Locator",
		"IceGrid/Locator:tcp -h 192.168.0.197 -p 12000");
		
	properties->setProperty(
		"Ice.ThreadPool.Client.Size",
		"10");
	
	properties->setProperty(
		"Ice.ThreadPool.Client.SizeMax",
		"10");
	
	Ice::CommunicatorPtr communicator;
	int argc=0;
	char** argv=0;
	communicator = Ice::initializeWithProperties(argc,argv,properties);	

Client is a webserve that runs 10 diferent threads an invoke the servant processRequest method
int 
WebAppHandler::run(MaRequest *rq)
{
	char* fileName = rq->getFileName();

	
	Oz::Web::WebRequest request;
	const char* uri=rq->getUri();
	if(uri!=NULL)
		request.uri=uri;
	Oz::Web::WebResponse response;
	response=applicationMamanger->processRequest(request);
	rq->writeFmt("%s",response.response.c_str());
        rq->flushOutput(MPR_HTTP_BACKGROUND_FLUSH,MPR_HTTP_FINISH_REQUEST);
	return MPR_HTTP_HANDLER_FINISHED_PROCESSING;
}

any clues to solve this?

Comments

  • Which operating system and version is this?

    I don't understand why you get this exception only after some time. The client thread pool is created when you create a communicator, so if for some reason no threads can be created on your operating system, you should get the error right away, when you connect to the server. Or does your application perhaps create multiple communicators, without properly destroying previously created communicators?
  • xdm
    xdm La Coruña, Spain
    Thanks mark your coment about communicator wrong destroyed solve my problem.

    my error was define communicator in module constructor and no as a varible member in the webModule, this make that my communicator goes out scope

    I can observer this problem in first time beacuse a lot of request go sucesfull before get this exception.

    now all is working as expected

    I'm realy impresed by Ice Perfomance. :D