The threads in AbstractWorkItemStore can miss exceptions
because they are only looking for, and reporting, StorageExceptions.
I have had my worklists generate other kinds of exceptions too!
Unfortunately these only get reported to the console and not to the
worklist.log
Not to mention, a StorageError in a worklist is a pretty severe error. I
find that an error level with stack trace is particularly useful when
diagnosing problems that crop up in production environments.
(new Thread()
{
public void run ()
{
final FlowExpressionId fei = wi.getLastExpressionId();
this.setName
("storage thread for "+fei.getWorkflowInstanceId()+
" exp "+fei.getExpressionId());
try
{
AbstractWorkItemStore.this.storeWorkItem(wi);
}
catch (StoreException se)
{
log.warn
("store() failed to store workitem "+
wi.getLastExpressionId());
log.debug
("store() failed to store workitem "+
wi.getLastExpressionId(),
se);
}
AbstractWorkItemStore.this.activeStorageThreads--;
}
}).start();
shoud become
(new Thread()
{
public void run ()
{
final FlowExpressionId fei = wi.getLastExpressionId();
this.setName
("storage thread for "+fei.getWorkflowInstanceId()+
" exp "+fei.getExpressionId());
try
{
AbstractWorkItemStore.this.storeWorkItem(wi);
}
catch (StoreException se)
{
log.warn
("store() failed to store workitem "+
wi.getLastExpressionId());
log.debug
("store() failed to store workitem "+
wi.getLastExpressionId(),
se);
}
catch (Throwabe t)
{
log.error
("store() failed to store workitem "+
wi.getLastExpressionId(), t);
}
AbstractWorkItemStore.this.activeStorageThreads--;
}
}).start();
Logged In: YES
user_id=56557
In general - any Thread run should have a catch for Throwable - just to
ensure no exceptions get past our logging. Did not look elsewhere for
similar issues.