Click here to Skip to main content
15,916,463 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: C# in F***ing Austria Pin
Bassam Abdul-Baki6-Sep-17 5:28
professionalBassam Abdul-Baki6-Sep-17 5:28 
GeneralRe: C# in F***ing Austria Pin
CodeWraith6-Sep-17 21:58
CodeWraith6-Sep-17 21:58 
General.NET stuff in Aussie ... Pin
HarvestMoon00002-Sep-17 11:14
HarvestMoon00002-Sep-17 11:14 
AnswerRe: .NET stuff in Aussie ... Pin
Ravi Bhavnani2-Sep-17 12:09
professionalRavi Bhavnani2-Sep-17 12:09 
GeneralRe: .NET stuff in Aussie ... Pin
HarvestMoon00002-Sep-17 23:45
HarvestMoon00002-Sep-17 23:45 
GeneralRe: .NET stuff in Aussie ... Pin
Dar Brett4-Sep-17 3:00
Dar Brett4-Sep-17 3:00 
GeneralRe: .NET stuff in Aussie ... Pin
HarvestMoon00004-Sep-17 6:29
HarvestMoon00004-Sep-17 6:29 
GeneralThe importance of logging, even in a production system - a story PinPopular
Marc Clifton2-Sep-17 5:20
mvaMarc Clifton2-Sep-17 5:20 
Alternatively, the subject line could rather be "The importance of unit testing!"

So I've been trying to figure out a gnarly problem over the last three days in our first test case of a major update to at one of the "clubs." Granted, it's really more of a pre-production test, but it's running with live data on a real site.

The idea is this -- cash out transactions are logged up to the cloud, where they can be reviewed, details inspected, etc. There are also system transactions (those that occur in a different way, things like charges, credits, whatever.)

The main app puts into a table all the transactions, with their type, and a separate service sends them up. So if something breaks, it's logged and doesn't affect the main app.

Now, for some reason, I coded two separate threads, one for uploading "normal" transactions, and the other for uploading "system" transactions. In hindsight, I'm not sure why I did this, except that they go to different endpoints, but that's not a good enough reason. Chalk it up to wanting to separate the processes because they create different datapackets of common data. No, chalk it up to over-design stupidity.

Anyways, for some mysterious reason, about 1/2 the cash out transactions were missing on the cloud. And bizarrely, the client reported that the transaction was uploaded without error.

WTF? How can I be missing cash out transactions yet the client said they all succeeded? That could only happen if the server sent back an "OK" for the status. Testing (not simulated, but live from the client) showed that the handler for the cash out transactions wasn't even being called! WTF! The handler isn't getting called, but the client still gets an "OK" response?

Well, as it turned out, the thread monitoring the table for new system transactions was missing a very important qualifier. Yup. Is it an actual system transaction? Roll eyes | :rolleyes: Sigh | :sigh: So, the cash out transaction was coming across as a system transaction instead, roughly 50% of the time, depending on which thread saw it first.

Figuring this out without logging the HTTPS POST's would have been nearly impossible. But thankfully, because I log all POST's to PaperTrailApp, I was able to find a good cash out transaction just before a set of missing ones. And there were the missing ones, as system transaction posts!

So there was the proof:
  1. Explains why the client was getting OK's back when it sent the transaction
  2. 100% correlation between the gaps of cash out transactions, sent instead as system transactions.
Now if I'd only written a unit test to verify that the transactions the system transaction monitor acquires were actually only system transactions, I would have found this problem a lot sooner!

Bug fixed. End of story.

Marc
Latest Article - Class-less Coding - Minimalist C# and Why F# and Function Programming Has Some Advantages

Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny

Artificial intelligence is the only remedy for natural stupidity. - CDP1802

GeneralRe: The importance of logging, even in a production system - a story Pin
abmv2-Sep-17 6:37
professionalabmv2-Sep-17 6:37 
GeneralRe: The importance of logging, even in a production system - a story Pin
Marc Clifton2-Sep-17 7:47
mvaMarc Clifton2-Sep-17 7:47 
GeneralRe: The importance of logging, even in a production system - a story Pin
PIEBALDconsult2-Sep-17 7:54
mvePIEBALDconsult2-Sep-17 7:54 
GeneralRe: The importance of logging, even in a production system - a story Pin
Sander Rossel2-Sep-17 8:52
professionalSander Rossel2-Sep-17 8:52 
GeneralRe: The importance of logging, even in a production system - a story PinPopular
Marc Clifton2-Sep-17 11:25
mvaMarc Clifton2-Sep-17 11:25 
GeneralRe: The importance of logging, even in a production system - a story Pin
abmv2-Sep-17 18:57
professionalabmv2-Sep-17 18:57 
GeneralRe: The importance of logging, even in a production system - a story Pin
charlieg3-Sep-17 4:39
charlieg3-Sep-17 4:39 
GeneralRe: The importance of logging, even in a production system - a story Pin
Marc Clifton9-Sep-17 9:44
mvaMarc Clifton9-Sep-17 9:44 
GeneralHappy Fathers Day Pin
Michael Martin2-Sep-17 4:34
professionalMichael Martin2-Sep-17 4:34 
GeneralRe: Happy Fathers Day Pin
Marc Clifton2-Sep-17 5:00
mvaMarc Clifton2-Sep-17 5:00 
JokeRe: Happy Fathers Day Pin
lopatir2-Sep-17 5:24
lopatir2-Sep-17 5:24 
GeneralRe: Happy Fathers Day Pin
PIEBALDconsult2-Sep-17 8:04
mvePIEBALDconsult2-Sep-17 8:04 
GeneralRe: Happy Fathers Day Pin
Michael Martin2-Sep-17 15:08
professionalMichael Martin2-Sep-17 15:08 
GeneralRe: Happy Fathers Day Pin
grralph12-Sep-17 12:36
grralph12-Sep-17 12:36 
GeneralRe: Happy Fathers Day Pin
Michael Martin2-Sep-17 15:09
professionalMichael Martin2-Sep-17 15:09 
GeneralSSD... is it worth it in an old computer? Pin
Joan M1-Sep-17 22:52
professionalJoan M1-Sep-17 22:52 
GeneralRe: SSD... is it worth it in an old computer? Pin
OriginalGriff1-Sep-17 23:01
mveOriginalGriff1-Sep-17 23:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.