Took me a minute but this seems to do it (though not on every run):
class Testy {
public static void main(String[] args) {
System.out.println("Spawning 3 threads");
Thread t1 = new Thread() { public void run() { try {
Runtime.getRuntime().exec("sleep", new String[]{ "1" }).waitFor(); }
catch(Exception e) { e.printStackTrace(); }
System.out.println("Finished 1"); } };
Thread t2 = new Thread() { public void run() { try {
Runtime.getRuntime().exec("sleep", new String[]{ "2" }).waitFor(); }
catch(Exception e) { e.printStackTrace(); }
System.out.println("Finished 2"); } };
Thread t3 = new Thread() { public void run() { try {
Runtime.getRuntime().exec("sleep", new String[]{ "3" }).waitFor(); }
catch(Exception e) { e.printStackTrace(); }
System.out.println("Finished 3"); } };
Thread t4 = new Thread() { public void run() { try {
Runtime.getRuntime().exec("sleep", new String[]{ "4" }).waitFor(); }
catch(Exception e) { e.printStackTrace(); }
System.out.println("Finished 4"); } };
System.out.println("Starting 1");
t1.start();
System.out.println("Starting 2");
t2.start();
System.out.println("Starting 3");
t3.start();
System.out.println("Starting 4");
t4.start();
System.out.println("Kthxbye");
}
}
$ javac Testy.java ; java Testy
Spawning 3 threads
Starting 1
Starting 2
Starting 3
Starting 4
Kthxbye
Finished 4
Finished 3
Finished 1
....Hangs
On Sat, Apr 23, 2016, at 12:07 AM, Elijah Zupancic wrote:
> Do you have a simple Java program that illustrates this?
>
> Thanks,
> Elijah
>
> On Fri, Apr 22, 2016 at 3:06 PM, Danny Wilson <[email protected]> wrote:
>> > But, the fix seems to work a little too good...
>> > Looks like processes aren't stopping when finished like they used
>> > to :D (tried master-20160422T105600Z)
>>
>> A little more detail:
>>
>> Non-finishing proceses occur when multiple threads do
>> Runtime.exec().
>> If I change my program to use only 1 thread that execs, there's no
>> issue.
>>
>>
>> >
>> >
>> > On Fri, Apr 22, 2016, at 06:05 PM, Robert Mustacchi wrote:
>> > > On 4/22/16 8:48 , Elijah Zupancic wrote:
>> > > > Hi Danny,
>> > > >
>> > > > The fix is included in the latest platform image available
>> > > > from the dev
>> > > > channel.
>> > >
>> > > Channels are an SDC-ism so if you're just running straight up
>> > > SmartOS,
>> > > this may be a bit confusing. In this case, the fix will be in
>> > > the
>> > > upcoming release on April 28th. There are nightly builds
>> > > available
>> > > though in manta if that's something you're interested in.
>> > >
>> > > Robert
>> > >
>> > > > On Apr 22, 2016 8:45 AM, "Danny Wilson" <[email protected]>
>> > > > wrote:
>> > > >
>> > > >> That's great to hear, I'm experiencing this issue as well.
>> > > >>
>> > > >> Is there an updated SmartOS build I could try? :-)
>> > > >>
>> > > >>
>> > > >> On Mon, Apr 18, 2016, at 06:06 PM, Elijah Zupancic wrote:
>> > > >>
>> > > >> This issue has now been fixed and checked in. If you are
>> > > >> interested the
>> > > >> details are here: https://smartos.org/bugview/OS-5323
>> > > >>
>> > > >> On Wed, Apr 13, 2016 at 12:23 AM, Jakob Borg <[email protected]>
>> > > >> wrote:
>> > > >>
>> > > >> For what it's worth, I've seen the same or similar behavior
>> > > >> with Java
>> > > >> processes (Jenkins build slave) under LX (latest platform as
>> > > >> of last week)
>> > > >> without any Docker involvement. In the end I didn't do the
>> > > >> full tracing to
>> > > >> debug it - I moved it to KVM instead. But the base behavior
>> > > >> of the Jenkins
>> > > >> slave process just suddenly exiting very soon after running a
>> > > >> git command,
>> > > >> with no error message in sight anywhere, was very
>> > > >> reproducible.
>> > > >>
>> > > >>
>> > > >> //jb
>> > > >>
>> > > >> 2016-04-12 12:06 GMT+02:00 Nigel Magnay
>> > > >> <[email protected]>:
>> > > >>
>> > > >>
>> > > >> Ok - I can successfully recreate this on the public cloud -
>> > > >> I'll send you
>> > > >> some details separately.
>> > > >>
>> > > >>
>> > > >> On Mon, Apr 11, 2016 at 9:08 PM, Nigel Magnay
>> > > >> <[email protected]>
>> > > >> wrote:
>> > > >>
>> > > >>
>> > > >> Sure - I'm going to try and get a test container up on the
>> > > >> Joyent cloud to
>> > > >> at least see if it does the same thing there.
>> > > >>
>> > > >> Interestingly, it looks like it's timing related. If I attach
>> > > >> a java
>> > > >> debugger to a debug socket when running the build, it doesn't
>> > > >> seem to fail.
>> > > >>
>> > > >>
>> > > >>
>> > > >> On Mon, Apr 11, 2016 at 8:28 PM, Elijah Zupancic
>> > > >> <[email protected]>
>> > > >> wrote:
>> > > >>
>> > > >>
>> > > >> Hi Nigel,
>> > > >>
>> > > >> I'm trying to verify this bug. I wasn't able to get your
>> > > >> Dockerfile to
>> > > >> build because it was missing associated files. Is there a way
>> > > >> for you to
>> > > >> build the Docker image and push it to Docker hub? If so,
>> > > >> could you then try
>> > > >> to distill the repro steps down to a single command that I
>> > > >> can execute
>> > > >> using docker exec?
>> > > >>
>> > > >> Thanks,
>> > > >> Elijah
>> > > >>
>> > > >> ...
>> > > >>
>> > > >>
>> > > >>
>> > > >>
>> > > >> --
>> > > >> -Elijah
>> > > >> *smartos-discuss* | Archives
>> > > >> <https://www.listbox.com/member/archive/184463/=now>
>> > > >> <https://www.listbox.com/member/archive/rss/184463/27824080-914e3e6d>
>> > > >> |
>> > > >> Modify <https://www.listbox.com/member/?&> Your Subscription
>> > > >> <http://www.listbox.com>
>> > > >>
>> > > >>
>> > > >> *smartos-discuss* | Archives
>> > > >> <https://www.listbox.com/member/archive/184463/=now>
>> > > >> <https://www.listbox.com/member/archive/rss/184463/27862676-268a510e>
>> > > >> |
>> > > >> Modify
>> > > >> <https://www.listbox.com/member/?&>
>> > > >> Your Subscription <http://www.listbox.com>
>> > > >>
>> > > >
>> > > >
>> > >
>> > >
>> >
>> >
>>
>>
>> http://www.listbox.com
>
>
>
> --
> -Elijah
> *smartos-discuss* | Archives[1] | Modify[2] Your Subscription
>
Links:
1. https://www.listbox.com/member/archive/184463/=now
2. https://www.listbox.com/member/?&
-------------------------------------------
smartos-discuss
Archives: https://www.listbox.com/member/archive/184463/=now
RSS Feed: https://www.listbox.com/member/archive/rss/184463/25769125-55cfbc00
Modify Your Subscription:
https://www.listbox.com/member/?member_id=25769125&id_secret=25769125-7688e9fb
Powered by Listbox: http://www.listbox.com