question about mmcache code, can any answer?

Xuefer
2004-04-19
2004-05-18
  • Xuefer
    Xuefer
    2004-04-19

    a. what if php timeout(time_limit) fire when mmcache is in LOCK_RW mode?
    it isn't released in RSHUTDOWN function
    it seems this lock is leaking when timeout.

    i've read sysvshm sysvsem standard/file.c, they all use php-resource, which will be automaticlly release(destruct) when request shutdown, thus no lock-leaking

    b.
    1    MMCACHE_UNPROTECT();
    2    MMCACHE_LOCK_RD();
    3    MMCACHE_PROTECT();
    ...
    4    MMCACHE_UNPROTECT();
    5    MMCACHE_UNLOCK_RD();
    6    MMCACHE_PROTECT();

    MMCACHE_PROTECT() seems disabled by default
    but if it's enabled (in further), when 2 process/thread execute in the order:
       5
    1
       6
    2
    3   ...

     
    • Xuefer
      Xuefer
      2004-04-19

      i blame sf.net -_-

      _5
      1_
      _6
      2_
      3_

       
    • Hős Endre
      Hős Endre
      2004-04-19

      Thanks, I'll take a look at lock-leaking. I'm thinking on a centralized persistent storage manager to simplify and generalize caching dataflow. Uhh, but first, it is a must to  fix the recent release breaking bugs.

       
      • For me this seems to be somehow related to the problem I've desccribed in bug id #955484.

        By the way, do you use sourceforge BTS?

         
        • Xuefer
          Xuefer
          2004-05-18

          i've already report it in bugs system
          but seems not same as yours.
          all my apache process is in W status, but with low cpu usage, those pages(request) without php will be fine (if there's free apache slot to process request)
          maybe it's because i didn't make my maxclients so large.

          but i'm sure it's a locking issue.
          when it MAY crash, it WILL crash. so there has to be a recover mechanism.
          (posted at http://sourceforge.net/tracker/index.php?func=detail&aid=954134&group_id=69426&atid=524490 but not "assigned")

          btw, "*serious* duplicate cache for same file" http://sourceforge.net/tracker/index.php?func=detail&aid=929556&group_id=69426&atid=524487
          is in TODO list(cvs), but the bug still not "assigned", why? i don't know how this team works -_- none of the bugs there is "assigned"

          btw, what is sourceforge "BTS"?

          seems i've said too much off this topic :)

           
    • Xuefer
      Xuefer
      2004-05-18

      for question "a"
      i've found that mmcache_clean_request() is called in request shutdown :)
      but don't know if the lock is safe to UNLOCK more than twice for all type of locks

      however, i've already changed to used FLOCK. it should be. it should be release by kernel on process crash.(i guess)