Welcome! Please see the About page for a little more info on how this works.

+1 vote
in Clojure by

Coming from java you might expect proxy-super to be pretty innocuous, but proxy-super operates by mutating the proxy object then restoring it after the call to proxy-super is invoked. This can lead to very weird behavior. If you have a proxy with method M, which invokes proxy-super, then while that proxy-super is running all calls to M on that proxy object will immediately invoke the super M not the proxied M.

Actually making proxy-super safe (not just threadsafe, but also safe when invoked later on in the same callstack) seems like it might be really hard, but it would be nice. Alternatively some blinking hazard lights in the docstring might be a good idea.

2 Answers

0 votes

Comment made by: freekpaans

I ran into this while trying to wrap calls to a queue: https://stackoverflow.com/questions/49862954/clojure-proxy-multithreading-issue

0 votes
Reference: https://clojure.atlassian.net/browse/CLJ-2201 (reported by hiredman)