Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Weird and The Wonderful
  4. Tasks and stack traces...

Tasks and stack traces...

Scheduled Pinned Locked Moved The Weird and The Wonderful
databasecomdesigndata-structuresdebugging
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Dave Kreskowiak
    wrote on last edited by
    #1

    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

    N 1 Reply Last reply
    0
    • D 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 Kreskowiak

      N Offline
      N Offline
      Nagy Vilmos
      wrote on last edited by
      #2

      Have you considered writing robust code? ;)

      Reality is an illusion caused by a lack of alcohol "Nagy, you have won the internets." - Keith Barrow

      D 1 Reply Last reply
      0
      • N Nagy Vilmos

        Have you considered writing robust code? ;)

        Reality is an illusion caused by a lack of alcohol "Nagy, you have won the internets." - Keith Barrow

        D Offline
        D Offline
        Dave Kreskowiak
        wrote on last edited by
        #3

        There are always speed bumps on the road to robustness. :laugh:

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak

        N 1 Reply Last reply
        0
        • D Dave Kreskowiak

          There are always speed bumps on the road to robustness. :laugh:

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak

          N Offline
          N Offline
          Nagy Vilmos
          wrote on last edited by
          #4

          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

          D 1 Reply Last reply
          0
          • N Nagy Vilmos

            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

            D Offline
            D Offline
            Dave Kreskowiak
            wrote on last edited by
            #5

            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

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups