Fork me on GitHub
#reveal
<
2022-02-28
>
sheluchin15:02:38

I find that sometimes if I tap a very large map, the Reveal window goes completely white and becomes unresponsive (i.e. doesn't show subsequent taps). I use the nrepl middleware as described https://vlaaad.github.io/reveal/#nrepl-based-editors. It seems the only way to fix it once it happens is to restart my JVM. Is this a known issue, and is there some better way to restart Reveal other than rebooting the JVM?

vlaaad18:02:09

Reveal is optimized for streaming big data structures though, I tried to make that part as fast and nonblocking as possible

vlaaad18:02:24

Can you share the data structure?

vlaaad18:02:26

Also is it possible that the data structure has self references? E.g. an atom that holds the reference to itself...

sheluchin19:02:37

The last time it happened to me I tapped an XTDB node. I don't know the internals well enough to say whether it has self references. I also don't think it happens every single time. Is there some Reveal debugging log I can access to get an idea of what's happening?

sheluchin19:02:21

Is there a way to reboot without rebooting the JVM? It would help me try to find a reproducible demo.

vlaaad19:02:36

I see that xtdb itself prints xtdb nodes without any internals:

(defmethod print-method XtdbNode [_node ^Writer w] (.write w "#<XtdbNode>"))

vlaaad19:02:20

maybe you could try the same? e.g.

(r/defstream XtdbNode [node]
  (r/raw-string "XtdbNode" {:fill :object}))

sheluchin19:02:03

Indeed, that is the usual representation when you print, but sometimes tapping it and looking at the keys is helpful for debugging. I also don't think this has been isolated to XTDB for me... it comes up during the course of debugging different once in a while.

vlaaad19:02:59

You'll probably be able to use view:table action to peek at contents

vlaaad19:02:29

or you could define streaming with some contents

vlaaad19:02:42

I'd suggest starting with changing the printing to XtdbNodes

vlaaad19:02:58

and maybe looking for exceptions on nrepl process output?

sheluchin19:02:59

I didn't see any exceptions pop up last time it happened, but I'll keep an eye out for that.

sheluchin19:02:01

Thanks @U47G49KHQ. I'll look at making a list of items in my project that should get different printing to try to avoid this.

sheluchin14:03:26

@U47G49KHQ I got around to setting up some streaming functions in my project today as you suggested. It's a great solution to the issue I was having and I'm looking forward to exploring other ways to customize and extend Reveal for my workflow as I get more familiar with the tool. Thanks again for the help! Just one more quick question about that. I put the defstream definition in my user namespace so it gets loaded when I start the REPL. Is that a reasonable place to put the customizations? Apologies if I missed it in the docs.

vlaaad14:03:38

Yes, very reasonable, I do the same

👍 1