IndexOutOfBoundsException in deamon thread

Today on on of our internal builds I am getting these exceptions. My first thought is data corruption in a specific log file. If so how do I go about finding which logfile is corrupt? This is not bad the data will be regenerated tomorrow any way. And access to most of the data in the bdb/je seems ok. Actually I have not been able to find an corrupt record.
Regards,
Jerven
<DaemonThread name="Checkpointer (BDB/je at uniprot)"/> caught exception: java.lang.IndexOutOfBoundsException
java.lang.IndexOutOfBoundsException
at com.sleepycat.bind.tuple.TupleInput.readBoolean(TupleInput.java:186)
at com.sleepycat.je.cleaner.PackedObsoleteInfo.countObsoleteInfo(PackedObsoleteInfo.java:60)
at com.sleepycat.je.log.LogManager.serialLogInternal(LogManager.java:671)
at com.sleepycat.je.log.SyncedLogManager.serialLog(SyncedLogManager.java:40)
at com.sleepycat.je.log.LogManager.multiLog(LogManager.java:388)
at com.sleepycat.je.recovery.Checkpointer.logSiblings(Checkpointer.java:1285)
at com.sleepycat.je.recovery.Checkpointer.flushIN(Checkpointer.java:970)
at com.sleepycat.je.recovery.Checkpointer.flushDirtyNodes(Checkpointer.java:709)
at com.sleepycat.je.recovery.Checkpointer.doCheckpoint(Checkpointer.java:476)
at com.sleepycat.je.recovery.Checkpointer.onWakeup(Checkpointer.java:266)
at com.sleepycat.je.utilint.DaemonThread.run(DaemonThread.java:161)
at java.lang.Thread.run(Thread.java:619)

I've been looking at this and my preliminary conclusion is that it is a rare concurrency bug in JE, it has been in existence for quite a while, but it has not been previously reported. It is not a persistent problem (no corruption or invalid data is stored), but once it occurs in an open Environment it will occur repeatedly -- at each checkpoint and perhaps during cache eviction. When the Environment is closed and reopened, checkpoints and eviction should then work normally, and no permanent damage will have been done.
It will take some time to reproduce this in a unit test and fix it. We will do that, and we'll be sure to resolve this before the next patch release. In the mean time, I suggest that you consider this to be an extremely rare occurrence and unlikely to occur again.
If you are seeing this repeatedly after shutting down the environment, then please let me know -- this would mean that my diagnosis is incorrect.
Thanks,
--mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Similar Messages

  • Deamon thread

    i want to about thread can we control deamon thread.

    It's very hard to understand your question, but I guess the answer is yes. A daemon thread is just a normal thread. The only difference is that the application will terminate if only daemon threads are executing.
    Kaj

  • Daemon thread still alive when the environment is closed

    I'm using the replication framework with the Java API in an OSGi container (equinox). I notice that when I'm closing the environment there is a deamon thread still alive. Each time I start a new replication environment and shut it down, one more daemon thread is added (and still running).
    Is there a way to close the replication framework and all their associated threads?
    I'm using BDB 4.7.25 - windows
    thanks
    dong

    Hi Dong,
    I don't know of a way to force the removal of the daemon thread(s).
    I believe that the thread is actually gone - as long as you are closing down the environment cleanly. The alternative to using daemon threads is to ensure that DetachCurrentThread is called by the JNI layer for each thread. Given the way the Berkeley DB Java API is implemented, that is not feasible.
    Are the additional threads causing issues?
    Regards,
    Alex

  • Java Thread Referencing

    What would be the best way to run a thread from a jsp and be able to check the status on that thread every once in a while?
    I currently have a jsp page that instantiates a Stateful Session Bean and saves the handle of that SSB in the servlet context. From the SSB I initialize and start a thread. The thread does a batch process which ends up taking hours, so my jsp page automatically refreshes itself and pulls the handle to the SSB from the servlet context and calls methods that retrieve statistics on the thread. For example there is a method in the SSB called PercentDone() which in turn calls a method in the thread called PercentDone() which returns an integer.
    My goal is to use the browser to start a batch process on the server and then monitor the progress of that batch process. I need the batch process to NOT be dependant at all on the browser, meaning I can shut it down and open it again and the process is still running and I can get a current stat on the process.
    What I have now works, but I have heard that in later versions of Java it won't, for some reason. I am toying with the idea of using a deamon thread but don't know how to reference the thread after having started it.
    I hope someone has some experience with something like this? I apreciate your time. Thank you

    Create some sort of "Job" table, and when you create your long-running task (thread), associate it with an entry in the Job table. You will need to pass the job handle to the thread when (or before) you start() it, of course.
    Your job thread should update the job status periodically, and your Job table should have methods to report the completion status and thread status of your thread. Don't have your thread unregister itself from the Job table when it's done, but instead, just set the thread handle in the Job table to null (otherwise you'll get a thread leak!), and periodically clean up old Job entries whose threads have died.
    Such a solution is quite portable, and works quite well. And more importantly, even if you kill your browser and restart it, on the server side, since the job table is universal, any browser can go find the previously submitted jobs and report on their status.

  • Why this Java Thread program doesn't work as expected?

    Hello all:
    I have a java code as follows:
    My question is why tryThreadB which is set as deamon thread still run
    after the main program return?
    the output of this program looks like:
    HopalongMarilyn HopalongMarilyn HopalongMarilyn HopalongMarilyn HopalongMarilyn Ending main()
    HopalongMarilyn HopalongMarilyn HopalongMarilyn HopalongMarilyn HopalongMarilyn HopalongMarilyn
    However, I think the correct output should be:
    HopalongMarilyn HopalongMarilyn HopalongMarilyn HopalongMarilyn HopalongMarilyn Ending main()
    Hopalong Hopalong Hopalong Hopalong Hopalong Hopalong Hopalong Hopalong
    ====================================
    <pre>
    import java.io.*;
    public class TryThread extends Thread {
    private String firstName;
    public TryThread(String firstName) {
    this.firstName = firstName;
    public static void main(String[] args) {
    TryThread tryThreadA = new TryThread("Hopalong");
    TryThread tryThreadB = new TryThread("Marilyn ");
    // user thread
    tryThreadA.setDaemon(false);
    // daemon thread
    tryThreadB.setDaemon(true);
    tryThreadA.start();
    tryThreadB.start();
    try {
    sleep(5000);
    catch (InterruptedException ex) {
    System.out.println("Ending main()");
    return;
    public void run() {
    try {
    while(true) {
    System.out.print(firstName);
    sleep(1000);
    catch (InterruptedException ex) {
    System.out.println(ex);
    </pre>
    ====================================
    thank you very much

    Hi,
    From the Thread documentation:
    When a Java Virtual Machine starts up, there is usually a single non-daemon thread (which typically calls
    the method named main of some designated class). The Java Virtual Machine continues to execute
    threads until either of the following occurs:
        * The exit method of class Runtime has been called and the security manager has permitted the exit
    operation to take place.
        * All threads that are not daemon threads have died, either by returning from the call to the run method
    or by throwing an exception that propagates beyond the run method.A daemon thread will not stop after the main method returns. It will stop when there are only daemon threads executing.
    So, in your case, thread B will continue to execute as long as thread A (or any other non-daemon thread) is alive.
    /Kaj

  • Tranport.connect() blocks or if timeout is set builds unstopable threads

    Hi,
    I'am really in trouble while trying to build a simple "send an email" functionality in my software.
    I'am trying to connect to a SMTP server that is unreachable (assume there is a firewall blocking the packets on there way to the SMTP server of my choice). The first problem was, that Transport.connect() does never finish. So this Forum told me: "set mail.smtp.connectiontimeout" and everything gets fine. This is true, as I get an exception when the connect takes to long.
    So everthing was fine to me, as long as the application was running. But as I stopped the application (its a server app) I saw one Thread for each connect that failed. And these Threads are no deamon threads so they prevent the VM from exiting. Even when they are deamon threads it is a bad habit, because I will get masses of threads over the time.
    Thats why I'am really in trouble. Does anybody knows a solution, where i can recognize that a timeout occured during connect and no "everlasting" is started?
    Here are some code snippets from my app:
    smtpServerProps.setProperty("mail.smtp.connectiontimeout", "10000");
    smtpServerProps.setProperty("mail.smtp.timeout", "10000");
    Session session = Session.getDefaultInstance(smtpServerProps);
    Transport trans = session.getTransport("smtp");
    trans.connect();
    mail.saveChanges();
    trans.sendMessage(mail, mail.getAllRecipients());
    trans.close();

    JavaMail 1.4 implements connection timeouts without needing an
    additional thread. Upgrade to JavaMail 1.4.

  • Thread Types

    How many types of threads available in Java ? What are they ? and What are deamon threads ?

    There is a chapter on threads under "Essential Java Classes" here: http://java.sun.com/docs/books/tutorial/

  • Threads within threads?

    When you create a new thread, does it execute only as a subthread of the thread that creates it? For example, if you create a new thread in your main thread, will that thread only have the possibility of executing when the main thread is running, or does it separate itself and become a completely independent task?

    When you create a new thread, does it execute only as
    a subthread of the thread that creates it? For
    example, if you create a new thread in your main
    thread, will that thread only have the possibility of
    executing when the main thread is running, or does it
    separate itself and become a completely independent
    task?It runs seperately but the thread that spawned it will not complete it has unles it is a deamon thread at which point the thread that spawned it will complete disableing the join capability. This is ok if there is no need to perform a join. the only thing is if the thread is deamon and was spawned by the main thread then when the main thread and all non deamon threads are complete the JVM will terminate the program and all deamon threads regardless of what they are doing. Not threads by default are not deamon.

  • Need help  regarding Daemon threads

    Hi to All
    What are deamon threrads ?
    Why we need to set Deamon(true)?
    explain me clearly
    I know deamon threads are low prior
    Again why we need to set to true.
    Help me

    You have two threads running. Neither one is daemon. One ends. The other keeps on running.
    You have two threads running. One is daemon. The daemon thread ends. The other keeps on running.
    You have two threads running. One is daemon. The other thread ends. The application ends because the only remaining thread is a daemon.
    You have five threads running. Three are daemon. A non-daemon thread ends. All other threads keep on running. A daemon thread ends. All other threads keep on running. The only remaining non-daemon thread ends. The application ends because the only remaining threads are daemons.
    Got it?

  • Simply delete all entries in a database.

    Hello,
    how do I simply delete all entries in a database (which must be thread safe, and most probably is)? For instance it is needed, as I'm developing a versioned open source XML/JSON database system, whereas I'm using a BerkeleyDB environment/database as a transaction log per revision (resource/log/version_number/...) for dirty blocks/pages and now want to introduce checkpointing (with currently only a single write-transaction per resource). That is another reading transaction (possibly another thread might read a transaction log, a BerkeleyDB environment/database while another thread, the checkpointer (most probably a deamon thread) commits, that is writes the log periodically or during less workload into the real resource. After the data is commited, the transaction-log must be emptied, but probably a reading transaction still reads from the log and falls back to reading from the real resource if the page is not in the log. That is I can't remove the database, but probably simply have to delete all entries and a simple .commit-file flag which indicates if the data has been written back to the real resource or the checkpointer must be writing it back sometime in the future (if the .commit-file still exists). Do I have to iterate through the database with a cursor (and .getNext())? Or does a dedicated method exist?
    kind regards
    Johannes

    Hi Johannes,
    As I think you've already discovered, there is no built-in method for deleting all records of a database that is open. The only similar built-in methods are those for removing or truncating an entire database (removeDatabase and truncateDatabase), and the database must be closed.
    If you can't find a way to use removeDatabase or truncateDatabase, then you'll have to iterate through the records and delete them individually. If this is done for a large numbers of records in a single transaction, it will be expensive on a number of fronts, including memory usage for the locks: each record is individually locked.
    If you don't need to delete all records in a single transaction (I couldn't completely understand your use case), then you can iterate with a cursor using READ_UNCOMMITTED and delete the records in individual transactions using Database.delete. This avoids using lots of memory for the locks, since only one record is locked at a time.
    In either case the cost can be reduced by using DatabaseEntry.setPartial(0, 0, true) for the DatabaseEntry that is passed as the data parameter. You only need the key to delete the record, not the data, and avoiding a fetch of the data is a big cost savings (if the record data is not in cache). This optimization is only in JE 5.0 and above --in JE 4.1 and earlier, this has no advantage because the data is always fetched internally, as part of the deletion operation.
    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Stoping timer problem

    Hi!
    I have timer that starts after first user login into the app. Problem is that this timer is alive after i redeploy app. only thing that can kill thet timer is shutdown of timcat. i know that there is timer.cancel() method but can anyone help me and tell me how can i recognize is there some timer active? I have some static variable that is 0 by default, and after timer stars i set that variable to 1, but after redeploying app variable is set to 0 and timer is still active...
    Tnx,
    Stanislav

    i dont know much about timers in java, but it seems a thread problem.
    are you sure that thread starting the timer is a deamon thread?
    http://asahin.net

  • Is running multiple instances of a class ok?

    hi guys,
    is it ok to have more than one instance of a class running?
    I have a console app that processes requests which have been saved in a db. this app does not need multithreading - but sometimes i may need to have multiple instances of the app running :-
    1) when there are too many requests in the db,
    2) or when i want to start another instance of the app to handle only specific duties.
    i mean this:
    i start my app:
    java myApp
    (the app is started once and does not stop for very long - heavy computing involved)
    then when i need another task to compute another task i start another instance (maybe with an option "specificDutyName" :
    java myApp specificDutyName
    Is this ok? no memory issues may arise?

    I think i am not able to follow your problem...
    when i do a java <AppName> <Any arguments/may be nothing>
    in reality I am starting off a JVM.
    If I do java <AppName> <Any arguments/may be nothing> again.... i would be starting of another JVM altogether..
    You may see two java.exe processes running in the task manager.. in case of a windows box.
    In such case if you may want to talk between applications running on two JVM's on the same machine.. you may need to resort to techniques like RMI and such...
    I dont think your requirement is so.. and this should be satisfied with simple multi-threading concepts.. you may start of a deamon thread that would keep on listening to a particular set of inputs.. which triggers of your new code path..
    Hope it makes sense..
    Vaibhav

  • Expiry-delay: how to evict an entry without "touching" it?

    I have a cache (called pending mutation cache) with an expiry-delay set to 30 seconds and a listener (com.tangosol.net.events.EventInterceptor, EntryEvent.Type.REMOVED) configured on the same cache.
    The objective: when an entry is evicted, the event interceptor code will be executed (some delayed operation we want to perform).
    But entries are not evicted after 30 seconds.  They will be evicted when an attempt is made to retrieve this entry after the 30 seconds delay.  (based on note in documentation)
    In my case, no client accesses the cache entries, so even though entries are expired, the event insterceptor is never triggered.
    This code is part of a pending mutation pattern (delayed cache modifications - based on expiry-delay of pending mutation cache) I am trying to implement.
    Any ideas how to achieve this?  Is there an elegant way to introduce a deamon thread that will sweep all entries in this cache and trigger the eviction?
    Tks!

    I have a cache (called pending mutation cache) with an expiry-delay set to 30 seconds and a listener (com.tangosol.net.events.EventInterceptor, EntryEvent.Type.REMOVED) configured on the same cache.
    The objective: when an entry is evicted, the event interceptor code will be executed (some delayed operation we want to perform).
    But entries are not evicted after 30 seconds.  They will be evicted when an attempt is made to retrieve this entry after the 30 seconds delay.  (based on note in documentation)
    In my case, no client accesses the cache entries, so even though entries are expired, the event insterceptor is never triggered.
    This code is part of a pending mutation pattern (delayed cache modifications - based on expiry-delay of pending mutation cache) I am trying to implement.
    Any ideas how to achieve this?  Is there an elegant way to introduce a deamon thread that will sweep all entries in this cache and trigger the eviction?
    Tks!

  • Help me with the design..IMP

    hi,
    i have a server which uses the following mechanism to log messages into a log file.
    public static void Message(String msg)
         print(msg);
    public void print( String msg )
         intprint(msg);
    private synchronized void intprint(String msg)
         i write into a log file using RandomAccessFile.
    the Message method is called by 100 of classes to write into the log file.since the intprint(--) is synchronized and with so many other classes trying to use it, it slows down my server.
    i was trying to have a design to make it faster.can somebody help me with that...any suggestions??
    Thanks,

    I guess that the slowing part of the process is writing to the file. Writing to memory is much faster, so put each msg string sent to intprint into a queue and use a deamon thread that empty the queue periodically to the disk. The idea is to split the sending of a string and the writing to the disk.
    That way, you will keep the order that the msg string are sent to the log and release the block/unblock waitings caused by synchronization.

  • How C++ client uses coherence message message pattern to subscribe/publish

    Hi,
    I need to know how c++ client can subscribe/publish messages on queue or topic?
    I was able to find messaging jar and common jar for java but I was not able to find any sort of c++ implementation.
    I think this feature is definitely supported by c++ and .Net. If there's any shared library please let us know or please share the messaging protocol and mechanism which we need to do in order to acheive topic/queue messaging feature.
    regards,
    Sura

    Hi Mark,
    As I know, in invocation service client will be the invoker for relevant query. So during the invocation we can get relevant results. But assume that after invocation there's some pending updates arrived to relevant topic. In that case do we need to pull again. If we need to pulll then we need to write a deamon thread by asking him to pull relevant topic data.
    Thanks a lot for the info. Hope you will share some expertise.
    regards,
    sura

Maybe you are looking for

  • CS3 Standard - Has stopped working

    I have just begun receiving error messages,"Adobe[Program]CS3 has stopped working..A problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available. This happens when I try to open Illus

  • Tools for UCCE/CVP Project phase?

    Hi, there are plenty of customer phasing/ post project wallboards, reporting tools, admin tools out there. My compnay is looking into some UCCE/CVP Project phase tools which can help the engineers in deisgn, deploy, call flow dev, testing etc phase o

  • List of Modified and New objects between two consecutive TRs/ TOCs

    Hi gurus, My requirement is to create a Z program that will give me a report of the objects that have been modified or newly created between two Transport Requests or Two TOCs containing the objects. I had created the program, but facing these diffic

  • Installing GC 10.2 on Windows

    This is when i'm installing it using a New Database.... When the Configuration Assistants are running, the OMS configuration fails. This is the error: INFO: Configuration assistant "DCM Repository Backup Assistant" succeeded INFO: Command = G:\OraHom

  • FF4 is not rendering my facebook plugin on my website properly [SOLVED]

    Since I upgraded to FF4, my facebook plug on my website now appears above the content AND in the content where it is supposed to be. It work fine on FF3 and works fine on IE8. Any suggestions?