Amgr freezing on a EmbeddedObject.getInputStream

I am having an issue with Amgr freezing on the EmbeddedObject.getInputStream java object method.

The code looks like this

[

while (doc != null &&

(System.currentTimeMillis() < stopTime)) {

if (!doc.hasItem("processed")) {

    RichTextItem rtitem = (RichTextItem) doc.getFirstItem("Body");

    System.out.println("Body = " + body);

    if (rtitem != null) {

       System.out.println("Got body");

       EmbeddedObject obj = rtitem.getEmbeddedObject("audit.xml");

    System.out.println("Obj = " + obj);

       if (obj != null) {

            System.out.println("Got obj");

            InputStream xmlStream = obj.getInputStream();

            //do stuff with stream

           obj.recycle();

       }

       rtitem.recylce();

    }

Document tmpDoc = dc.getNextDocument(doc);

    doc.recylce();

    doc = tmpDoc;

}

}

]

The //do stuff with stream isn’t implemented in the actual agent so it’s not like there’s code in there doing something. This is the actual loop that running. There was code running there but has been removed in the effort to determine what was causing the agent to freeze.

After running some number of iterations, it freezes. The last println in the log is the “Obj = blah” which makes me think it’s dying on the getInputStream. Obj is NOT null. It has run through as few as 6 iterations and up to 300. There’s actually about 4000 documents to process and I’ve got code that stops the loop after 8 minutes (that what the System.currentTumeMillis() < stopTime does).

What will happen is once the agent freezes, Amgr continues to show that it is running the agent. Amgr is also reporting very high CPU utilization. It will continue to run indefinately. Telling Amgr q won’t shut it down. Killing AMgr with a kill -9 causes domino to lock up which requires a restart.

The server is R6.5.3 running on Redhat ES 3.0.

Thanks

Zach Mabe

Subject: Amgr freezing on a EmbeddedObject.getInputStream

Try closing the InputStream as you go and see if that makes any difference.
dgg

while (doc != null && (System.currentTimeMillis() < stopTime)) {
if (!doc.hasItem(“processed”)) {
RichTextItem rtitem = (RichTextItem) doc.getFirstItem(“Body”);
System.out.println("Body = " + body);
if (rtitem != null) {
System.out.println(“Got body”);
EmbeddedObject obj = rtitem.getEmbeddedObject(“audit.xml”);
System.out.println("Obj = " + obj);
if (obj != null) {
System.out.println(“Got obj”);
InputStream xmlStream = obj.getInputStream();
if (xmlStream != null) {
xmlStream.close();
System.out.println(“InputStream closed”);
}
//do stuff with stream
obj.recycle();
}
rtitem.recylce();
}

    Document tmpDoc = dc.getNextDocument(doc);
    doc.recylce();
    doc = tmpDoc;
}

}