Support Requests: Browse | Submit New | Admin

[#29524] Not able to clear NDC on exception

Date:
2012-02-16 14:45
Priority:
3
Submitted By:
Jeff Williams (jeffw)
Assigned To:
Nobody (None)
Category:
None
State:
Open
Summary:
Not able to clear NDC on exception

Detailed description
I have code that looks like this:


NDC.push("pid:#{$$}")
while true
  begin
    while task = get_task()
      NDC.push("[#{task.id}]")

      process_task1(task)
      process_task2(task)
      ....

      NDC.pop
    end

  rescue => e
    NDC.clear
    NDC.push "pid:#{$$}"
    logger.error "blah"
    sleep 60
  end
end

I however, this doesn't appear to reset the NDC. It it gets an exception in the process_task functions, it just keeps
growing the NDC, which means I get log lines like:

2012-02-16 14:40:38 INFO pid:17760 [13675151] [13670651] [23412342] Message

which is not ideal. I've also tried NDC.remove, with no change. Any ideas?

Jeff

Add A Comment: Notepad

Please login


Followup

No Followups Have Been Posted

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

No Changes Have Been Made to This Item