uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jaroslaw Cwiklik <uim...@gmail.com>
Subject Re: UIMA-AS client is blocking
Date Wed, 31 Mar 2010 13:52:07 GMT
You are not calling cas.release() when you are done with the CAS.
Per UIMA AS documentation ("4.2 The UimaAsynchronousEngine Interface - CAS
getCAS()"

"...CAS getCAS(): Requests a new CAS instance from the CAS pool. This method
blocks until a free instance of CAS is available in the CAS pool.
Applications that
use getCAS() need to call CAS.reset() before reusing the CAS, or
CAS.release()
to return it to the Cas pool."

The release() places a CAS back into the pool so the subsequent call to
getCAS()
succeeds. An alternate strategy is to have a single CAS instance in the CAS
pool
call getCAS() to get that instance and enter a while loop. When done
processing
reply, call cas.reset() and do *not* call getCAS() again.

JC

On Tue, Mar 30, 2010 at 5:41 AM, pierre yahoo <ppujalon@yahoo.fr> wrote:

> I'm trying to use UIMA-AS to scale a part of the process of our
> application.
> I have successfully deployed our process as asynchronous services but I
> have tremendous issues with the client.
>
> I'm basically looping synchronously(one at a time) on the following code.
>     CAS cas = uimaEEEngine.getCAS();
>     JCas jcas;
>     try {
>        jcas = cas.getJCas();
>     } catch (CASException e) {
>         throw new ResourceProcessException(e);
>     }
>     fillCas(jcas);
>     uimaEEEngine.sendCAS(cas);
>
> When I run the application, the client works fine for a while and suddenly
> gets stuck waiting on cas.getJCas()..
> I have checked that the asynchronous service have processed all the
> previous  CAS.  The service is still up and running as I can send requests
> from an another client.
> When I tracked down who locks the process, I can see that the semaphore on
> CasQueueEntry is not released.
> When I looked further, I noticed that the all process is basically lock
> when the CasManager_Impl is calling CasPool.getCas(0) . The CasPool is then
> waiting with no timeout for someone to notify it.
>
> I try to change the size of the client CasPool but it didn't really fix the
> issue. Just pushing further the lock...
>
> Does anyone have ever experienced this? Am I doing something wrong ?
>
> Pierre
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message