karouani / javasimon

Automatically exported from code.google.com/p/javasimon
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Deadlock problem when using Split.stop(String) with more than one subSimon name and SimonManager.clear() #130

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Started 10 threads, each thread loops the following:
  a) Split s = SimonManager.getStopwatch("TEMP").start();
  b) s.stop("" + r.nextInt(2));     //where r is java.util.Random to produce a subSimon of name "0" or "1"
2. Started 1 thread that loops the following:
  a) System.out.println(org.javasimon.utils.SimonUtils.simonTreeString(SimonManager.getRootSimon()));
  b) SimonManager.clear();
  c) Thread.sleep(1000);
3. The threads started in step #1 end up deadlocking.

What is the expected output? What do you see instead?
Expect this application to run without deadlocking.

What version of the product are you using? On what operating system?
javasimon-core-4.0.1
I have run this on both MAC OS X and z/OS both result in the same problem.

Please provide any additional information below.
Two observations:
1) When Split.stop(String subSimon) only uses a single subSimon name the 
deadlock doesn't appear to occur, only when two or more subSimon names are used.
2) When SimonManager.clear() is not issued the deadlock doesn't appear to occur

I have provided two files:
1) My test cases that can recreate the problem.
2) A thread dump showing the blocked threads and the stack trace of where they 
are blocked.

Original issue reported on code.google.com by khite1...@gmail.com on 29 Dec 2014 at 10:38

Attachments:

GoogleCodeExporter commented 8 years ago
My first observation is incorrect, I was able to recreate the problem with a 
single subSimon as well, but so far I cannot recreate the problem when using 
Split.stop() only Split.stop(String subSimon).

1) When Split.stop(String subSimon) only uses a single subSimon name the 
deadlock doesn't appear to occur, only when two or more subSimon names are used.

Original comment by khite1...@gmail.com on 29 Dec 2014 at 10:53

GoogleCodeExporter commented 8 years ago
We will track it on github: https://github.com/virgo47/javasimon/issues/11
Closing it here...

Original comment by virgo47 on 1 Jan 2015 at 2:19