|
Great ! Thanks for the info !
|
|
|
|
|
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? 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:
- Explains why the client was getting OK's back when it sent the transaction
- 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
|
|
|
|
|
Could this have been debugged? Visual studio...
|
|
|
|
|
abmv wrote: Could this have been debugged? Visual studio...
Yes, if I would have thought that some other handler was receiving the post instead. I might have eventually gotten there in one of those "try anything" moments of desperation, but it wasn't even in my consciousness yet to try that. The voice that kept asking "who the heck is responding" wasn't being listened to.
Marc
|
|
|
|
|
|
|
You do realize that I've forgotten more than I currently know.
|
|
|
|
|
tut tut mark .. you need to take some memory enhancing drugs or exercise those grey cells ...
|
|
|
|
|
" No, chalk it up to over-design stupidity."
An honest developer....
Charlie Gilley
<italic>Stuck in a dysfunctional matrix from which I must escape...
"Where liberty dwells, there is my country." B. Franklin, 1783
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
|
|
|
|
|
charlieg wrote: An honest developer....
I'm honest with other developers. Management on the other hand, is a different story.
|
|
|
|
|
To anyone and any country celebrating it today. Ticked over here in Australia about 30 minutes ago. Getting to bed so I can have a sleep before drinking away tomorrow today.
Michael Martin
Australia
"I controlled my laughter and simple said "No,I am very busy,so I can't write any code for you". The moment they heard this all the smiling face turned into a sad looking face and one of them farted. So I had to leave the place as soon as possible."
- Mr.Prakash One Fine Saturday. 24/04/2004
|
|
|
|
|
Huh. It's July 17 here in the States. Well, Happy Father's Day to you down under!
|
|
|
|
|
Marc Clifton wrote: Huh. It's July 17 here in the States
Time moves that much slower there?
You guys really need to go metric.
signature upgrading ... please wait.
|
|
|
|
|
|
Marc Clifton wrote: Huh. It's July 17 here in the States. Well, Happy Father's Day to you down under!
That's in the middle of Winter here so wouldn't be so good for barbecues. Thanks, both kids are working but should be a pretty good day anyway.
Michael Martin
Australia
"I controlled my laughter and simple said "No,I am very busy,so I can't write any code for you". The moment they heard this all the smiling face turned into a sad looking face and one of them farted. So I had to leave the place as soon as possible."
- Mr.Prakash One Fine Saturday. 24/04/2004
|
|
|
|
|
|
grralph1 wrote: Have a good one Mick.
Is this the worst thing that has ever happen to beer or the best thing that has ever happened to yoga?
Beer yoga coming to Canberra at Capital Brewing Co in Fyshwick[^]
Thanks, same to you if you have kids. If you are anywhere close to the Sydney area (within a couple of hours) we'll have to catch up for a drink some time. You can keep the Yoga bit to yourself though.
Michael Martin
Australia
"I controlled my laughter and simple said "No,I am very busy,so I can't write any code for you". The moment they heard this all the smiling face turned into a sad looking face and one of them farted. So I had to leave the place as soon as possible."
- Mr.Prakash One Fine Saturday. 24/04/2004
|
|
|
|
|
Hello all,
My parents have two computers... a new i5 that is wonderful and an old one (Intel® Core™2 Duo E6600) that takes ages to start.
It is clear that the HDD spins endlessly.
Would you spend 100€ in a SSD?
I don't know if that would mean a huge improvement in the performance of that computer or not...
Should SSD work despite being an old computer?
Any hint?
Of course I could buy a new computer, but in this case I don't think it is needed as my father is using it only to download kitchen recipes...
|
|
|
|
|
YES!
Oh yes, yes yes...
I run a E6700 @ 3.2GHz, with 4GB of RAM - and a 1TB SSD (plus a 1TB HDD for data).
The performance difference when I fitted the SSD was phenomenal. Windows booted quickly, VS loaded fast, even Corel PaintShop Pro X8 became usable!
It genuinely changed the way I worked: instead of loading everything - because they took forever to start - I load, use, close and everything is quicker because the load time is so short, and the RAM is free.
Well worth the money!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
|
Thank you OG for both answers!
I'll take a look at it, but probably I'll reinstall everything as I'm planning to get a 256 GB SSD... It has no sense getting anything bigger but the current HDD is much bigger so I don't know if AOMEI would cope with that...
|
|
|
|
|
Depends how much is used space - if it's using less than the new SSD, then repartition it to the same size and the wizard will move everything. And that way bookmarks, passwords, logins, and the app someone forgot about but desperately needs right now still work exactly as it did, but better.
If it isn't, then you're going to be looking at having both installed anyway (organised as OS/app and data perhaps?) so a good solid backup first would be a damn good idea...
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I'll definitely look at it.
Thank you!
|
|
|
|
|
100% agree with Griff, about a year back it's exactly what I did...
1. large (1TB) HDD to smaller (500 G) SSD - used space on HDD was about 300G
2. Aomei Partition Assistant - the Free version
Ran the wizard, chose the options (simple, obvious), off she went.
Less than a hour later without unplugging anything (just Bios change) booted from the SSD - zero issues.
After initial housekeeping on the SSD I used the Aomei to do the reverse copy (yes, even though it says it's for HDD->SSD it 100% works the other way too) - done in case needed to re-restore after some heavy duty cleaning up I had planned (i.e. removing spurious software, device drivers and other windows system cruft.)
signature upgrading ... please wait.
|
|
|
|
|
Did you mean to respond with this to Joan?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|