core.async

Using onto-chan with nonending sequence causes non-gc-able, infinitely-looping go block

Details

  • Type: Defect Defect
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    org.clojure/core.async 0.1.256.0-1bf8cf-alpha

Description

(close! (to-chan (range)))

The above code causes my CPU to run at around 95% until I kill the process. (NOTE: This eventually leads to an OutOfMemoryError – see ASYNC-32).

Here is what I think is happening: after closing the channel returned by to-chan, all subsequent puts to that channel by the to-chan go block succeed immediately without blocking. Because the to-chan go block never blocks on its drain channel, it runs continuously and can't be GC'd (if I understand things correctly).

Activity

Hide
Leon Grapenthin added a comment -

I'd expect the behavior. Neither can to-chan know that (range) returns an infinite sequence, nor can it know that it's output channel has been closed.

Show
Leon Grapenthin added a comment - I'd expect the behavior. Neither can to-chan know that (range) returns an infinite sequence, nor can it know that it's output channel has been closed.
Hide
Brian Lubeski added a comment -

Resolved in 0.1.278.0-76b25b-alpha.

Show
Brian Lubeski added a comment - Resolved in 0.1.278.0-76b25b-alpha.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated: