• 0 Posts
  • 4 Comments
Joined 2 years ago
cake
Cake day: June 27th, 2023

help-circle

  • I got dumped with fixing some bugs in a project written by a contractor who had literally done this but with extra steps.

    Backend was sql server and c#/asp.

    There was an api endpoint that took json, used xslt to transform to xml. Then called the stored procedure specified in request passing the xml as a parameter.

    The stored procedure then queried the xml for parameters, executed the query, and returned results as xml.

    Another xslt transformed that to json and returned to the client.

    It was impressive how little c# there was.

    Despite holding all the business logic, the sql was not in source control.


  • Had a 3 year old one this week. A loop that builds a list of messages to send to a queue for another service to consume then it calls BatchPublish.

    Only Batch Publish was inside the loop so instead of sending n messages, it sends 1+2+3… +n

    We never noticed before because n was never more then 100 and the consuming service is idempotent so the duplicate messages don’t cause issues. I think it’s (n(n-1))/2. So n=100 is 4950. That’s only 4 minutes work. Also that code only runs at 1am.

    Recently n has been hitting 1000 which produces 499500 messages and it takes a few hours to clear and triggers an alarm for delayed processing.