Open issues

(CLJS) cljs alts! not non-deterministic
ASYNC-227
(CLJS) Port ASYNC-169 fixes to cljs
ASYNC-184
(CLJS) try-catch-finally broken inside go-blocks
ASYNC-73
Finally block executed twice
ASYNC-229
let in go block leaks memory
ASYNC-223
can't assign instance fields in go blocks
ASYNC-222
go ignores async code in letfn body
ASYNC-221
an exception caught in a finally block swallows the exception of the outer try
ASYNC-220
some locals are not cleared in go blocks
ASYNC-219
pipeline does not stop consuming from when to is closed
ASYNC-217
`go` fails to compile expressions with literal `nil` as a let value
ASYNC-212
`a/map` close out channel immediately when any one of inputs closed
ASYNC-211
Puts committed on take! when buffer is full and buffer contains an expanding transducer
ASYNC-210
<! and >! should be macros
ASYNC-209
alts!! completes more than one operation when reading and writing to the same channel.
ASYNC-208
Pausing in mix is note effective
ASYNC-205
Writing on a closed channel doesn't commit the handler
ASYNC-204
"dynamic binding + parking" removes top values of dynamic bindings outside
ASYNC-203
(CLJS) A "finally" in a "try" in a "go" block is skipped in f a string is thrown.
ASYNC-200
(CLJS) A "finally" including an "if" breaks the result of the enclosing "try" if the "try" is in a "go" block
ASYNC-199
core.async exception rewriting can result in an incorrect return value
ASYNC-198
`async/map` output channel not close, when has some input channel not closed, even if I closed one channel of inputs.
ASYNC-197
(CLJS) Some non-tail-recursive loops compile without error
ASYNC-190
Completion arity of transducer is called twice
ASYNC-183
(CLJS) Support usage from bootstrapped clojurescript
ASYNC-182
(CLJS) excluded bounded-count in use in cljs.core.async
ASYNC-175
Executor service cannot be shutdown
ASYNC-174
binding in go block causes thread binding error: "Pop without matching push"
ASYNC-170
(CLJS) the binding macro/let binding is wrongly inlined
ASYNC-165
(CLJS) go block containing letfn does not compile
ASYNC-156
Convert project to use Reader Conditionals
ASYNC-141
(CLJS) Make (<! (timeout 0)) be closer to 0
ASYNC-137
(CLJS) Can't close over locals in #js in go
ASYNC-132
Channels with transducer using reduced don't work as intended
ASYNC-129
(CLJS) or evaluation not stopped when exp nests take
ASYNC-128
mult distribution behavior doesn't work as intended
ASYNC-127
Add public channel "closed?" predicate
ASYNC-126
Closing a tap with a pending item blocks the mult input channel
ASYNC-125
(CLJS) let-bindings unavailable in #js literals in go-blocks
ASYNC-117
Clarify timeout doc to mention that close! should not be called on a timeout channel
ASYNC-109
implement IDeref, IBlockingDeref for channels
ASYNC-102
(CLJS) alts! sporadically failing to unblock despite channel activity (Safari 7)
ASYNC-97
Allow user supplied executor/thread-pool (and potentially other options) to be used in go, thread macros and chan
ASYNC-94
go macro removes binding forms that are intialized with logical false value
ASYNC-92
Pub/sub leaks memory
ASYNC-90
(CLJS) go macro not correctly transforming (case) within a macro
ASYNC-79
Provide a chan? function to determine if a given var is a channel
ASYNC-74
exception behavior for thread macro is hard coded
ASYNC-71
Race condition when closing mults
ASYNC-64
mult channel deadlocks when untapping a consuming channel whilst messages are being queued/blocked
ASYNC-58
issue 1 of 94

(CLJS) cljs alts! not non-deterministic

Description

In cljs, clojure.core.async/random-array's shuffle was incorrect, leading it to always return [1 0] for arg n=2. This breaks the promise that alts! is non-deterministic w.r.t. op selection by always trying the second element first. Additionally, the first op is never chosen first for alts! of any size N>1.

Use goog.array.shuffle to do the shuffle instead. (This API is also used by cljs.core/shuffle)

New implementation passes tests and behaves better:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 cljs.user=> (frequencies (take 10000 (map vec (repeatedly #(a/random-array 2))))) WARNING: var: cljs.core.async/random-array is not public at line 1 <cljs repl> {[0 1] 4964, [1 0] 5036} cljs.user=> (frequencies (take 10000 (map vec (repeatedly #(clojure.core.async/random-array 3))))) WARNING: var: cljs.core.async/random-array is not public at line 1 <cljs repl> {[0 1 2] 1720, [1 2 0] 1679, [2 0 1] 1669, [0 2 1] 1573, [1 0 2] 1682, [2 1 0] 1677} cljs.user=> (pp) {[0 1 2] 1720, [1 2 0] 1679, [2 0 1] 1669, [0 2 1] 1573, [1 0 2] 1682, [2 1 0] 1677} nil

Environment

None

Status

Assignee

Ghadi Shayban

Reporter

Ghadi Shayban

Labels

None

Approval

None

Patch

Code

Priority

Critical