#715 Add garbage collection support for event semaphores


If you submit a 'SEM WAIT EVENT ...' request, then delete its handle (such as by killing the STAX job), the request will persist indefinitely, waiting for an event that may never get posted. The problem is exacerbated by the facts that A) there is not 'SEM CANCEL EVENT' request analogous to 'SEM CANCEL MUTEX' and B) you cannot delete an event semaphore with pending Waiters. The only wait to remove the waiters is to either post the event or restart STAFProc.

This bug seems very similar to bug #2861597, which dealt with the QUEUE service instead of the SEM service.


  • asomers

    asomers - 2012-08-29

    Shell script to reproduce the problem

  • asomers

    asomers - 2012-08-29

    STAX file used by the shell script

  • Sharon Lucas

    Sharon Lucas - 2012-09-04

    This is because the STAF SEM service does not provide garbage collection support for event semaphores. Garbage collection support is only provided for mutex semaphores. This is why the STAF User's Guide only talks about garbage collection support for mutex semaphores, not event semaphores, and why there is no GARBAGECOLLECT option for a "SEM WAIT EVENT" request and no "SEM CANCEL EVENT" request.

    If you require garbage collection support for event semaphores, post again and I'll change this to a feature request (instead of a bug) and it will go into the queue of open STAF feature requests. I do not know when it will be implemented.

    Note that garbage collection support for mutex semaphores created via the SEM service and for the RESPOOL service was first added in STAF V3.0.0. No one else has requested garbage collection support for event semaphores.

  • asomers

    asomers - 2012-09-04

    I think that this would be a very good feature to have. Without it, there is the potential for resource leaks. Event requests can linger forever and so can the event semaphores themselves. A SEM CANCEL EVENT request would allow the resources to be freed, albeit manually.

    At my site, I typically see up to a hundred or so zombie waiters, but my work isn't otherwise blocked.

  • Sharon Lucas

    Sharon Lucas - 2012-09-05
    • labels: 712604 --> Service::Sem
  • Sharon Lucas

    Sharon Lucas - 2012-09-07
    • summary: 'sem wait event' requests do not get garbage collected --> Add garbage collection support for event semaphores

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks