Drawbridge sessions can't be serialized #15

Closed
sritchie opened this Issue Jul 20, 2014 · 14 comments

Projects

None yet

3 participants

@sritchie
Contributor

When I try to use drawbidge with clj-redis-session, I get this error on connection

java.lang.IllegalArgumentException: No method in multimethod 'print-dup' for dispatch value: class clojure.tools.nrepl.transport.QueueTransport.

Would it make sense to add something to the docs about how you need to be using an in-memory session store? OR, better yet, Drawbridge would handle its own session store, if this is a requirement.

Owner

Drawbridge sessions (IIRC) are a superset of nREPL sessions, which contain a total mapping of all thread-bindable vars in each session's environment (e.g. *out*, *print-length*, anything else defined to be ^:dynamic). This, plus the fact that these vars can contain handles to local resources and/or arbitrary (often non-serializable) JVM objects means that a general solution for this problem is not available. Sorry. :-|

There's definitely room for some kind of explicitly-serializable nREPL session, but it would yield subtly different behaviour than the existing nREPL session middleware's implementation, and different behaviour still compared to explicitly local REPLs like Clojure's default stdin/out REPL and the local lein repl.

@cemerick cemerick closed this Jul 20, 2014
Owner

Oh, happy to take a PR noting this in the docs or whatever, if you're so inclined to produce one.

Contributor

Okay, good to know. Another way to deal with this problem (of using this middleware in systems that use cookie-based sessions) would be to allow Drawbridge to optionally manage its own, in-memory session store. Would you take a PR for that?

Contributor

(also, thanks, @cemerick!)

Contributor

ping - happy to work on this one, just want to know if I should prep a pull req or fork.

Owner
cemerick commented Aug 2, 2014

A PR is fine. I'm not dead, just missing. :-P

Contributor
sritchie commented Aug 3, 2014

Thanks!

Chas Emerick mailto:notifications@github.com
August 2, 2014 at 7:21 AM

A PR is fine. I'm not dead, just missing. :-P


Reply to this email directly or view it on GitHub
#15 (comment).

Sam Ritchie (@sritchie)
Paddleguru Co-Founder
703.863.8561
www.paddleguru.com http://www.paddleguru.com/
Twitter http://twitter.com/paddleguru// Facebook
http://facebook.com/paddleguru

Any progress on a store, @sritchie? And perhaps any workarounds for this?

Contributor

Haven't done this yet, as we haven't been using drawbridge, but it should be an easy change.


Sent from Mailbox

On Mon, Nov 24, 2014 at 9:03 AM, Petrus Theron notifications@github.com
wrote:

Any progress on a store, @sritchie? And perhaps any workarounds for this?

Reply to this email directly or view it on GitHub:
#15 (comment)

@sritchie can you recommend an alternative to Drawbridge? I don't see any other way to live-debug Clojure apps deployed to Heroku :/.

Contributor

I think drawbridge should be perfect with that one small change, honestly. I don't know of any other alternatives out there.


Sent from Mailbox

On Mon, Nov 24, 2014 at 9:56 AM, Petrus Theron notifications@github.com
wrote:

@sritchie can you recommend an alternative to Drawbridge? I don't see any other way to live-debug Clojure apps deployed to Heroku :/.

Reply to this email directly or view it on GitHub:
#15 (comment)

I'm not sure what the needed store changes are. Would a potential workaround be to modify clj-redis-session's handler to check if the uri starts with "/repl" and pass through?

Contributor

instead of using the session from the middleware, Drawbridge needs to maintain its own little state atom internally of incoming session id -> drawbridge state.

Contributor
sritchie commented Jan 3, 2015

@pate try this pull req out: #18 This should fix the issue. Would love a comment on that pull req if it works for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment