Menu

#37 [worklist] AbstractWorkItemStore store() misses exceptions

closed-accepted
worklist (8)
7
2005-06-15
2005-05-03
No

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();

Discussion

  • John Mettraux

    John Mettraux - 2005-05-04
    • labels: 486867 --> worklist
    • priority: 5 --> 7
     
  • John Mettraux

    John Mettraux - 2005-05-04
    • status: open --> open-accepted
     
  • Anonymous

    Anonymous - 2005-05-04

    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.

     
  • John Mettraux

    John Mettraux - 2005-06-15
    • status: open-accepted --> closed-accepted
     

Log in to post a comment.