Make interactive debugging easier.

It's fair game to handle errors and issue logs instead when using the
pgloader binary image, as it distracts users a lot. That said, as a
developer the interactive debugger is very useful.

In passing install some experimental thread killing behavior in case of
errors and using on-error-stop setting (default for database migrations).
This commit is contained in:
Dimitri Fontaine 2019-01-07 20:42:36 +01:00
parent 9ce4088b48
commit e4a4edb276
2 changed files with 11 additions and 5 deletions

View File

@ -74,13 +74,17 @@
(incf task-count)))
(lp:task-handler-bind
((copy-init-error
(#+pgloader-image
(copy-init-error
#'(lambda (condition)
;; everything has been handled already
;; stop the other tasks and then transfer the control
(log-message :log "COPY INIT ERROR")
(lp:kill-tasks :default)
(lp:invoke-transfer-error condition)))
(on-error-stop
#'(lambda (condition)
;; everything has been handled already
(log-message :log "ON ERROR STOP")
(lp:kill-tasks :default)
(lp:invoke-transfer-error condition)))
#+pgloader-image
(error

View File

@ -147,7 +147,8 @@
(*summary-pathname* . ,*summary-pathname*)
(*sections* . ',*sections*)))
(kernel (lp:make-kernel 1 :bindings bindings))
(lparallel:*kernel* kernel))
(lparallel:*kernel* kernel)
(lparallel:*task-category* :monitor))
;; make our kernel and channel visible from the outside
(setf *monitoring-kernel* kernel
@ -155,7 +156,8 @@
*monitoring-queue* (lq:make-queue))
(lp:task-handler-bind
((error
(#+pgloader-image
(error
#'(lambda (c)
;; we can't log-message a monitor thread error
(lp:invoke-transfer-error