Tasks and stack traces...
-
I'm in the middle of writing an app that imports a ton of data from an old version of an application (written by commitee!) with about a dozen tables in it to a database of more than 80 tables. Of course, because of the horrendous nature of the existing data (and we NEED it!), it has to be edited, parsed, interpreted, scrubbed, validated, normalized, blah, blah, blah, and takes many passes to go through and build the new database. So, I'll wrap my automated scrubbers and importers in Tasks, to keep my UI alive and show me what's its doing along the way, right? Right! Well, when you do that, the Tasks can "bloat" your stack trace when something goes horribly wrong. How bloated you ask? Well, the code can throw a stack trace of about 20-23 lines long. But, put that same code inside of a Task and blow it up the exact same way and the stack trace jumps to a mind blowing 163 lines, with inner exceptions going six levels deep! WTE!!
A guide to posting questions on CodeProject[^]
Dave Kreskowiak -
I'm in the middle of writing an app that imports a ton of data from an old version of an application (written by commitee!) with about a dozen tables in it to a database of more than 80 tables. Of course, because of the horrendous nature of the existing data (and we NEED it!), it has to be edited, parsed, interpreted, scrubbed, validated, normalized, blah, blah, blah, and takes many passes to go through and build the new database. So, I'll wrap my automated scrubbers and importers in Tasks, to keep my UI alive and show me what's its doing along the way, right? Right! Well, when you do that, the Tasks can "bloat" your stack trace when something goes horribly wrong. How bloated you ask? Well, the code can throw a stack trace of about 20-23 lines long. But, put that same code inside of a Task and blow it up the exact same way and the stack trace jumps to a mind blowing 163 lines, with inner exceptions going six levels deep! WTE!!
A guide to posting questions on CodeProject[^]
Dave KreskowiakHave you considered writing robust code? ;)
Reality is an illusion caused by a lack of alcohol "Nagy, you have won the internets." - Keith Barrow
-
Have you considered writing robust code? ;)
Reality is an illusion caused by a lack of alcohol "Nagy, you have won the internets." - Keith Barrow
There are always speed bumps on the road to robustness. :laugh:
A guide to posting questions on CodeProject[^]
Dave Kreskowiak -
There are always speed bumps on the road to robustness. :laugh:
A guide to posting questions on CodeProject[^]
Dave KreskowiakYou're simply not trying hard enough. Put each iteration of the loop in a giant
try-catch
and quick as a Hollywood marriage all your problems are sorted. You could even go the extra mile and log the exceptions.Reality is an illusion caused by a lack of alcohol "Nagy, you have won the internets." - Keith Barrow
-
You're simply not trying hard enough. Put each iteration of the loop in a giant
try-catch
and quick as a Hollywood marriage all your problems are sorted. You could even go the extra mile and log the exceptions.Reality is an illusion caused by a lack of alcohol "Nagy, you have won the internets." - Keith Barrow
Yeah, right! Too bad I need to fix all the problems with the data, otherwise I would ignore 'em and log 'em. The script the app runs already generates about 120MB worth of log data just showing what it sees in the data and what it does to it.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak