I’m gonna level with you guys. I made a view tracker for my website in PHP and I’m chasing a really obscure bug where it wipes out all the accumulated views but it’s like one of those 1 in 5000 chance bugs so now I’m just uploading this here to try and accumulate some views so it might happen while I’m looking at it… Sorry; enjoy the picture

  • redline23@lemmy.world
    link
    fedilink
    arrow-up
    5
    ·
    7 months ago

    That sounds like a possible race condition when multiple requests are executing at the same time. Without knowing anything about the design, perhaps you could look into database transactions. You could also look into generating load via jmeter, but then we wouldn’t get a picture.

    • drkt@feddit.dkOP
      link
      fedilink
      arrow-up
      2
      ·
      7 months ago

      Using SQLite seems to have solved it, but it’s still bogged down by disk IO speeds. The only way I can induce errors right now is with benchmark tools, and that’ll be solved if I use an in-memory DB hopefully.