The scenario is:
and we have deadlock.
So I don't think it will be too helpful to get into a deep discussion about our usage of JavaFX, but I'm wondering if anybody else has run into this problem, and if there's some miracle solution I'm not aware of.
The two things I can employ to mitigate/solve this problem:
Is there something I'm missing? Is there some architectural master stroke somebody can fill me in on to deal with this problem quickly and easily?
One of the things I'm looking to do now is start failing integration tests when they notice the potential for this deadlock. My plan for this is to have SyncingUtilitles.runImmediatelyOnFXThread and guice singletons act like resource acquisitions, with each checking to see if the thread they're running on has already acquired the other. If they have, they would log some kind of warning that they may be entering deadlock. logging a warning will fail our cucumber performance tests and our ranorex UI automation tests, which should prevent us from pushing new code with these issues.
I haven't started writing that provision listener, is it technically possible?
Thanks for any help!
-Geoff
I believe I've avoided this by 1) using eager singletons and 2) separating object creation from service starting. (I.e. Constructors only construct, and then a start/stop method is required for all services that "do stuff".)
--
You received this message because you are subscribed to the Google Groups "google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-guice...@googlegroups.com.
To post to this group, send email to google...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-guice.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-guice/2b89be39-c127-45e0-871d-4e46b42812ae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Agreed. Generally making your objects cheap to construct and separating initialization from construction using something like guava's ServiceManager for startup/shutdown logic.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-guice/CAHNex9_yOGiT05y52944yQQOrJEWEGZPeoNC350MHaZ27fLOyQ%40mail.gmail.com.
class SomeComponent implements SomethingInitializerWants{
@Inject
public SomeComponent(Dep1 one, Dep2 two /*...*/
InitializerService initializer){
this.one = one;
this.two = two;
initializer.register(this);
}
@Override
public void doMoreInitialization(){
one.configure(this, 1.234);
this.madeModel = two.factorySomething(stuff());
}
//...
}
To view this discussion on the web visit https://groups.google.com/d/msgid/google-guice/b6575c52-4929-4cba-bcf3-3d56ac9eab32%40googlegroups.com.