Skip to content

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

Open
@joinr

Description

@joinr

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 at path "path-to-file", from the repl:

    (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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bughigh priorityTickets of particular importance

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions