vipx / google-guice

Automatically exported from code.google.com/p/google-guice
Apache License 2.0
0 stars 0 forks source link

Execution of a MethodInvocation.proceed() can cause an infinite loop #652

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago

I think the example code attached is the best explanation...

The idea is to call the proceed() from a separate thread, but it seems to re 
trigger the interception point again..

Wonder if there is a nice way to avoid, is it by design?

Original issue reported on code.google.com by big...@gmail.com on 9 Sep 2011 at 8:46

Attachments:

GoogleCodeExporter commented 9 years ago
Check out

http://groups.google.com/group/google-guice/browse_thread/thread/bedc8410a822bdd
0

Original comment by alen_vre...@yahoo.com on 10 Sep 2011 at 1:06

GoogleCodeExporter commented 9 years ago
That is exactly what happens... Great link!
It is kinda of ... suprising

Original comment by big...@gmail.com on 10 Sep 2011 at 2:01

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
If other folks find this a problem, please vote/ping the bug.  As-is, I don't 
have much of an inclination to fix since there's a workaround (albeit a real 
hack of a workaround), and fixing would be a pretty big change to the internals 
with possibly some negative side effects.

Original comment by sberlin on 16 Oct 2011 at 4:11

GoogleCodeExporter commented 9 years ago
Just run into this issue as well, while trying to implement an @Async 
annotation. What's the workaround?

Original comment by eric.j...@gmail.com on 20 Apr 2012 at 7:51

GoogleCodeExporter commented 9 years ago
Any reason the attached patch won't work?  It passes all the tests and seems 
simple enough.

Original comment by tavianator@gmail.com on 8 Oct 2013 at 10:45

Attachments:

GoogleCodeExporter commented 9 years ago
That's a pretty good workaround.  Could you maybe add a new multi-threaded test 
that would have broken prior to the patch also?

Original comment by sberlin on 8 Oct 2013 at 11:01

GoogleCodeExporter commented 9 years ago
Sure, attached.  The test isn't multi-threaded for simplicity, but it captures 
the root of the problem.

Original comment by tavianator@gmail.com on 8 Oct 2013 at 11:41

Attachments:

GoogleCodeExporter commented 9 years ago
Nice, this LGTM, I'll patch it and test against our corpus and submit if there 
are no errors.  Thanks for submitting it!

Original comment by sberlin on 9 Oct 2013 at 12:27

GoogleCodeExporter commented 9 years ago
Any luck with this patch?

Original comment by tavianator@gmail.com on 8 Dec 2013 at 12:32

GoogleCodeExporter commented 9 years ago

Original comment by sberlin on 11 Dec 2013 at 11:47