immutant

http://immutant.org Note: dev discussion happens in #immutant on FreeNode IRC.
arnout 2016-02-26T15:34:59.000044Z

Hi all, does anyone know how Immutant the Deuce does Clojure runtime/app isolation? Is it still the same or comparable to http://immutant.org/news/2012/05/18/runtime-isolation/?

2016-02-26T15:36:07.000045Z

arnout: Immutant 2 from an uberjar does no isolation at all, since you can only run one app from the uberjar. If you deploy those apps to a WildFly container, however, you will have isolation between the apps

arnout 2016-02-26T15:36:37.000047Z

Each container having there own Clojure runtime?

2016-02-26T15:36:56.000048Z

in WildFly, each app will have its own clojure runtime, yes

arnout 2016-02-26T15:37:10.000049Z

Ok, thanks @tcrawley !

2016-02-26T15:37:16.000050Z

my pleasure!

2016-02-26T15:56:03.000051Z

@ddellacosta: howdy! I commented on https://issues.jboss.org/browse/IMMUTANT-610, but am happy to discuss it here

2016-02-26T15:56:22.000052Z

@jcrossley3: ^

2016-02-26T15:59:21.000053Z

@tcrawley: i concur with your proposed fix. worth submitting a patch to @weavejester ?

2016-02-26T15:59:30.000054Z

yeah

2016-02-26T16:26:12.000056Z

@tcrawley I suppose that solution would work. Note that this also affects compojure (https://github.com/weavejester/compojure/blob/6cbc8a95a3d6fc0d3f4b98130db92ff89b8176f0/src/compojure/core.clj#L213-L214) but if I understand what you are proposing, the way :path-info is extracted in compojure also uses the :url value as a fallback so should work. I guess what makes me nervous is that this behavior is not very explicit. Seems to me that regardless of whether ring is patched or not, it would be useful to make this explicit in the undertow configuration in immutant.

2016-02-26T16:27:11.000059Z

the reason why undertow decodes the path-info is that it's mandated by the servlet spec

2016-02-26T16:27:17.000060Z

oh no, I guess the compojure bit would have to be patched separately

2016-02-26T16:27:48.000061Z

jetty does it as well, but the ring-jetty-adapter doesn't stick the :path-info in the request

2016-02-26T16:27:49.000062Z

oh yeah—to be clear, I’m more proposing (as one alternative) that DECODE_URL is described in the undertow options in immutant, not necessarily that it should be changed by default

2016-02-26T16:29:04.000063Z

I mean, I still think you’re right, seems like ring/compojure shouldn’t be doing what they’re doing

2016-02-26T16:29:28.000064Z

I'm not opposed to exposing it as an option, but my concern is setting it will cause that app to then potentially fail if it's deployed to WildFly

2016-02-26T16:29:42.000065Z

especially if decoding of the path is mandated by the spec—seems like ring/compojure is doing the wrong thing here

2016-02-26T16:29:47.000066Z

yeah, I can see your argument

2016-02-26T16:30:24.000067Z

well, I’m happy to help offer a patch for both. Does it make sense, furthermore, that jetty behave differently here? I guess one point I’m confused on is why jetty doesn’t store this information in the ring request

2016-02-26T16:31:48.000068Z

looking at that compojure code - is path even used?

2016-02-26T16:33:13.000069Z

the reason the jetty adapter doesn't set :path-info is because it was never used to host apps anywhere other than the root context (/). :path-info support in ring came about from people trying to run apps as wars in containers or when using Immutant 1, so it's kinda an afterthought

2016-02-26T16:34:21.000070Z

the path-info is definitely used in params in compojure, and that’s how I found this issue in the first place

2016-02-26T16:35:02.000071Z

I think if compojure does need path-info, it should be modified to use request/path-info, once it is fixed to decode the uri

2016-02-26T16:35:09.000072Z

that seems reasonable

2016-02-26T16:35:33.000073Z

and I believe that it would have to be using :path-info somewhere, I just don't see it in the code you linked is all

2016-02-26T16:35:59.000074Z

I'd be happy to file an issue with ring, or support you if you want to do it

2016-02-26T16:37:36.000075Z

re: path-info getting used in compojure, it’s actually another layer of indirection—the clout function route-matches splits up the path-info and then returns it as params (https://github.com/weavejester/clout/blob/5b943e7d04279f40dd743800478c486e164593fd/src/clout/core.clj#L46), where it then gets decoded

2016-02-26T16:37:50.000078Z

anyways, let me read through this a bit more

2016-02-26T16:38:03.000079Z

I still don’t like how this is all under the covers, in ring and compojure at least