KTP - spawn function and max thread limit.

KTP - spawn function and max thread limit.

book

Article ID: KB0084646

calendar_today

Updated On:

Products Versions
TIBCO KTP -
Not Applicable -

Description

Resolution:
Description:
=========
The KTP function spawn relies on the pthread-create C++ operation. KTP assumes that the operation succeeds Should the operation fail this solution describes how to confirm and what to do.

Environnement:
============
Solaris / Linux

Symptoms:
========
New thread creation failed with the following operating system error message published in the engine log file:

2011-04-04 10:04:04.010629|EXP|WARN |36|osdisp.cpp(1121)|CATCH(DSEException)
2011-04-04 10:04:04.010941|EXP|WARN |36|dseexcpt.cpp(406)|STACK TRACE:
  +++ START +++
    pthrd.cpp (444): THROW SWThread::ThreadResourceError: reason: 'Operating system error: function 'pthread_create': error code (11): error string 'Resource temporarily unavailable''
    pthrd.cpp (447): RETHROW SWThread::ThreadResourceError
    engthrd.cpp (262): RETHROW SWThread::ThreadResourceError
    engthrd.cpp (532): RETHROW SWThread::ThreadResourceError
    engine.cpp (1976): RETHROW SWThread::ThreadResourceError
    logsubscriber_mimpl0.cpp (136): RETHROW SWThread::ThreadResourceError
    logsubscriber_mimpl0.cpp (138): RETHROW SWThread::ThreadResourceError
    logsubscriber_skl0.cpp (241): RETHROW SWThread::ThreadResourceError
    osdisp.cpp (1121): DUMP SWThread::ThreadResourceError
  +++ END +++

Cause:
=====
The total number of threads in a process, PTHREAD_THREADS_MAX has been exceeded. This can occur for 2 reasons:

1). The RLIMIT_NPROC soft resource limit (set via setrlimit), which limits the number of process for a real user ID, was reached.

2). The kernel's system-wide limit on the number of threads, /proc/sys/kernel/threads-max, was reached.

Resolution:
========
Increase the max threads value but make sure that you have sufficient memory to do so because by default, pthread_create() creates a stack for the new thread with at least 1 megabyte for 32-bit processes  and  2  megabytes  for 64-bit processes.

Issue/Introduction

KTP - spawn function and max thread limit.