Home Help Center

Threads don't die and continue to create if server is down

ywtsangywtsang Member Yiu WingOrganization: yesasiaProject: search engine
we run client on tomcat 6, sending request to an ice server

we have configured ThreadPool to have multiple threads serving ice requests

if our ice server is down (e.g. down for deployment, network problemt, etc), we find that the client threads don't die, but create a new set of threads, and this repeats, and result in many threads are created until the server is up again

eventually, many threads (we have experienced more than 1000+ or more that may even halt the whole OS) are spawned, all those threads are with stack trace like:

<code>
Stack trace:
java.lang.Object.wait(Native Method)
java.lang.Object.wait(Object.java:485)
IceInternal.ThreadPool.run(ThreadPool.java:896)
IceInternal.ThreadPool.access$100(ThreadPool.java:12)
IceInternal.ThreadPool$EventHandlerThread.run(ThreadPool.java:1242)
</code>

those spwaned threads are alive and have names that are duplicated
Ice.ThreadPool.Client-8
Ice.ThreadPool.Client-8
Ice.ThreadPool.Client-8
Ice.ThreadPool.Client-8
....

so we suspect that threads cannot die gracefully and ice still keep creating new threads

we cannot prevent the ice server to die, any suggestion for this problem?

Comments

  • mesmes CaliforniaAdministrators, ZeroC Staff Mark SpruiellOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    The Ice run time will not add more threads to the thread pool once the maximum thread pool size is reached. What value are you using for Ice.ThreadPool.Client.SizeMax?

    By the way, when asking for help, please always specify the version of Ice that you're using, along with the language(s), compiler(s), and operating system(s).

    Thanks,
    Mark
  • ywtsangywtsang Member Yiu WingOrganization: yesasiaProject: search engine
    we set both
    Ice.ThreadPool.Client.Size
    Ice.ThreadPool.Client.SizeMax
    to the same value


    both server and client are
    - using java
    - running on linux (server = 32bit, client = 64bit)


    server is using
    1.5.1
    (by running slice2java -v)

    client is using the following jar:

    <dependency>
    <groupId>zeroc.ice</groupId>
    <artifactId>ice</artifactId>
    <version>3.2.1-1</version>
    </dependency>


    server compiler (by running gcc -v):
    Reading specs from /usr/lib/gcc-lib/x86_64-redhat-linux/3.2.3/specs
    Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --host=x86_64-redhat-linux
    Thread model: posix
    gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-53)


    please let me know if you want more information, many thanks


    p.s. for now, we want to have some quick fixes instead of "upgrade" ice if necessary as we may have some restrictions (time limit) to upgrade ice

    very apprepricate i can get quick response here
Sign In or Register to comment.