Improve threads error handling.

See #328 where we are lacking useful stack trace in a --debug run
because of the previous talk-handler-bind coding, that was there to
avoid sinking the users into too many details. Let's try another
approach here.
This commit is contained in:
Dimitri Fontaine 2016-01-24 21:43:46 +01:00
parent b2ec66c84b
commit 4e36bd3c55

View File

@ -151,7 +151,13 @@
(lq:make-queue :fixed-capacity *concurrent-batches*))))
(with-stats-collection ((target copy) :dbname (db-name (target-db copy)))
(lp:task-handler-bind () ;; ((error #'lp:invoke-transfer-error))
(lp:task-handler-bind
((error #'(lambda (condition)
(log-message :error "A thread failed with error: ~a"
condition)
(if (member *client-min-messages* (list :debug :data))
(lp::invoke-debugger condition)
(lp::invoke-transfer-error condition)))))
(log-message :info "COPY ~s" table-name)
;; start a task to read data from the source into the queue