Skip to content

Commit e4a4edb

Browse files
committed
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).
1 parent 9ce4088 commit e4a4edb

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

src/load/copy-data.lisp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,17 @@
7474
(incf task-count)))
7575

7676
(lp:task-handler-bind
77-
((copy-init-error
77+
(#+pgloader-image
78+
(copy-init-error
7879
#'(lambda (condition)
79-
;; everything has been handled already
80+
;; stop the other tasks and then transfer the control
81+
(log-message :log "COPY INIT ERROR")
82+
(lp:kill-tasks :default)
8083
(lp:invoke-transfer-error condition)))
8184
(on-error-stop
8285
#'(lambda (condition)
83-
;; everything has been handled already
86+
(log-message :log "ON ERROR STOP")
87+
(lp:kill-tasks :default)
8488
(lp:invoke-transfer-error condition)))
8589
#+pgloader-image
8690
(error

src/utils/monitor.lisp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,15 +147,17 @@
147147
(*summary-pathname* . ,*summary-pathname*)
148148
(*sections* . ',*sections*)))
149149
(kernel (lp:make-kernel 1 :bindings bindings))
150-
(lparallel:*kernel* kernel))
150+
(lparallel:*kernel* kernel)
151+
(lparallel:*task-category* :monitor))
151152

152153
;; make our kernel and channel visible from the outside
153154
(setf *monitoring-kernel* kernel
154155
*monitoring-channel* (lp:make-channel)
155156
*monitoring-queue* (lq:make-queue))
156157

157158
(lp:task-handler-bind
158-
((error
159+
(#+pgloader-image
160+
(error
159161
#'(lambda (c)
160162
;; we can't log-message a monitor thread error
161163
(lp:invoke-transfer-error

0 commit comments

Comments
 (0)