Last Friday I was working at a customer where I had to Copy & Paste some person document’s into a secondary address book. Every time I attempted to do it the process would hang and simply wouldn’t stop unless I manually broke it off (CTRL + BREAK). Now I had to paste about 600 records so this was not good news. After some investigation I found the culprit in the “(RenamePastedAccounts)” agent that had an infinite loop in it.
Now this agent is really, really simple. It loops through all the pasted documents and simply checks for a specific value in a field. If found it does something to that field and goes to the next document…..
Right, so do you see the mistake there?
If the value is NOT in the field it will never go to the next document, effectively doing the same check on the same document over and over again.
While Not doc Is Nothing
If ‘value in field’ Then
Set doc = dc.getnextdocument(doc)
It was easy to solve (just move the line that sets the document outside of the If clause) but I just couldn’t help but chuckle. I think it demonstrates a fundamental flaw in development when it comes to testing. We’ve probably all done it. The difficult work you test and have tested but that simple procedure, that so easy to code action…… You know what it needs to do, you know how to do it and you are so confident about what you’re doing that you forget to test it…. thoroughly.
So even at Big Blue, with all it’s checks and testing this can happen it seems. Just glad it’s not my name in that agent, knowing it will be distributed in hundreds of thousands of Domino environments, inevitable found and blogged about on sites around the globe and causing SPR’s to be opened and Technotes to be published…… It’s there for the world to see and there’s nothing you can do but pray everybody upgrades before they ever run into it. And until it is corrected in a new version that honestly simple, stupid mistake will haunt you forever.
Ana……I feel for you.
Coming from someone that only last week managed to literally bring down a (test) server with a similarly simple and obvious coding mistake.