From 8b1acbae877b1e5a2c5274ff8937d2ffaef8b922 Mon Sep 17 00:00:00 2001 From: Dimitri Fontaine Date: Fri, 16 Nov 2018 00:03:31 +0100 Subject: [PATCH] Make sure the image knows how to print circular data structures. Our catalogs representation is designed to be circular, which helps navigating the graph from anywhere when processing it. This means that we need to have *print-circle* set to t in the pgloader image, otherwise we might run into Control stack exhausted when trying to print out debug information... Fixes #865, #800, #810, #859, #824. --- src/hooks.lisp | 7 +++++++ src/utils/threads.lisp | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/hooks.lisp b/src/hooks.lisp index bb27ea2..62c878b 100644 --- a/src/hooks.lisp +++ b/src/hooks.lisp @@ -12,6 +12,13 @@ ;; So that we can #+pgloader-image some code away, see main.lisp (push :pgloader-image *features*) +;;; +;;; We need to support *print-circle* for the debug traces of the catalogs, +;;; and while at it let's enforce *print-pretty* too. +;;; +(setf *print-circle* t *print-pretty* t) + + (in-package #:cl-user) (defun close-foreign-libs () diff --git a/src/utils/threads.lisp b/src/utils/threads.lisp index 2581579..bfa6876 100644 --- a/src/utils/threads.lisp +++ b/src/utils/threads.lisp @@ -7,7 +7,9 @@ (defun make-kernel (worker-count &key (bindings - `((*monitoring-queue* . ,*monitoring-queue*) + `((*print-circle* . ,*print-circle*) + (*print-pretty* . ,*print-pretty*) + (*monitoring-queue* . ,*monitoring-queue*) (*copy-batch-rows* . ,*copy-batch-rows*) (*copy-batch-size* . ,*copy-batch-size*) (*rows-per-range* . ,*rows-per-range*)