clojure-emacs / clojure-emacs/cider

Cider buffered printing strategy doesn't work with large files as intended

Open
#2,635 5 comments 2 reactions 0 assignees View on GitHub
bug high priority
Dominant language
Emacs Lisp
Stars
3.7k
Forks
651
Avg merge
11h 6m
Merged PRs (30d)
33

Description

## Expected behavior
Cider 0.21 should - upon trying to print large amounts of text (e.g. > 1mb) gracefully halt for us, and during printing, print in chunks as to enable user interruption.

## Actual behavior
When working with a ~3mb tab delimited text file, Cider tries to chunk print, but grinds to a halt as emacs starts to freeze. If user is fast enough and interrupts, the REPL is recoverable (this must happen within the first few chunks of printing). If user does not interrupt, and lets the printing continue unabated, Cider does not seem to reach the graceful cutoff point (I let it run for about 30s just to see). User can interrupt cider only with (cider-interrupt). At that point, REPL prompt reappears, but further evaluation is disabled. It seems like the nREPL process is hung up. CPU utilization confirms emacs is still grinding trying to do something (20% vs. 0% resting).

## Steps to reproduce the problem
Given the uncompressed raw text file [stored in gzipped format here](https://github.com/joinr/lametestdata/raw/master/test.tar.gz) at path "path-to-file", from the repl:

```quote
(def path "path-to-file")
(def res (slurp path))
res ;;if not interrupted immediately, this will hang the repl
;;we can get similar behavior if we slurp the file directly and print the output
;;e.g. (slurp path), with no intermediate binding to res.
```

## Environment & Version information

### CIDER version information

CIDER 0.21.0 (New York), nREPL 0.6.0
Clojure 1.10.0, Java 1.8.0_181

### Lein/Boot version
leiningen 2.9.1

### Emacs version
25.3

### Operating system
Windows 10

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.