sitebricks icon indicating copy to clipboard operation
sitebricks copied to clipboard

Embeddedrespondfactory threading issue

Open jwmach1 opened this issue 13 years ago • 5 comments

When Guice Stage.PRODUCTION, and more than one request was being served by the same PageTuple, they ended up sharing the same StringBuilderRespond -- kaboom!

so I moved the private final Respond respond = new StringBuilderRespond(new Object()); declaration of EmbeddedRespondFactory into the get method. Hopefully this pull request reflects that one small change to EmbeddedRespondFactory.

jwmach1 avatar Feb 14 '12 23:02 jwmach1

Holy crap, this should never happen--thanks let me chase it down!

dhanji avatar Feb 14 '12 23:02 dhanji

This pull request is messed up because I branched from the wrong spot. sorry. The next one will be better :)

jwmach1 avatar Feb 14 '12 23:02 jwmach1

Hehe, OK, thanks!

dhanji avatar Feb 14 '12 23:02 dhanji

Do you have a fix for this yet?

dhanji avatar Apr 20 '12 23:04 dhanji

I never got this pull request cleaned up. The Fix is changing one file -- EmbeddedRespondFactory like this

https://github.com/jwmach1/sitebricks/blob/master/sitebricks/src/main/java/com/google/sitebricks/rendering/control/EmbeddedRespondFactory.java

I did not see any negative side effects to instantiating a new new StringBuilderRespond(new Object()); for each EmbeddedRespond.

-James

On Fri, Apr 20, 2012 at 6:57 PM, dhanji < [email protected]

wrote:

Do you have a fix for this yet?


Reply to this email directly or view it on GitHub: https://github.com/dhanji/sitebricks/pull/16#issuecomment-5255474

jwmach1 avatar Apr 23 '12 13:04 jwmach1