Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LinkedTransferQueue.size() Liveness Hazard #6136

Closed
scabug opened this issue Jul 24, 2012 · 6 comments

Comments

@scabug
Copy link

commented Jul 24, 2012

Hello,

There appears to be an issue with the version of the JSR166 LinkedTransferQueue that ships with Scala 2.9.2 (also confirmed under 2.9.1) that can result in calls to LTQ.size() spinning infinitely and failing to return. This issue does not occur when using the latest version of LinkedTransferQueue in JSR166y.

We've run into this issue in production at Boundary a few times and finally sat down to reproduce it. Fortunately, it is very easy to trigger and has been fixed upstream in the JSR166 project.

Steps to reproduce in Scala 2.9.2:

  1. Run the attached "Repro.scala" sample program with: scala Repro.scala
  2. Observe output similar to bug-reproduced.txt (attached)
  3. Notice that calls to .size() stop increasing as the call does not return.

Steps to demonstrate success with the latest version of JSR166:

  1. Fetch the latest JSR166 at http://gee.cs.oswego.edu/dl/jsr166/dist/jsr166y.jar
  2. Replace "import scala.concurrent.forkjoin.LinkedTransferQueue" with
    "import jsr166y.LinkedTransferQueue" in Repro.scala below.
  3. Run the "Repo.scala" sample program with: scala -cp jsr166y.jar Repro.scala
  4. Observe output similar to bug-resolved.txt (attached)

If possible, I would recommend upgrading this package (or at least LinkedTransferQueue) to the latest available release of JSR166.

Regards,

Scott Andreas
s@boundary.com


NB: This report and the following attachments can also be viewed as a Gist for your convenience: https://gist.github.com/3025111

@scabug

This comment has been minimized.

Copy link
Author

commented Jul 24, 2012

Imported From: https://issues.scala-lang.org/browse/SI-6136?orig=1
Reporter: C. Scott Andreas (cscotta)
Affected Versions: 2.9.1, 2.9.2
Other Milestones: 2.11.0-M5
Attachments:

@scabug

This comment has been minimized.

Copy link
Author

commented Aug 16, 2012

C. Scott Andreas (cscotta) said (edited on Aug 16, 2012 8:08:25 PM UTC):
Just lost another node to this.

Here's the relevant section of the thread dump showing all of these threads caught in this state: https://gist.github.com/3373146

And here's a CPU graph for the past day as threads slowly became stuck in this state due to the bug: http://cl.ly/image/1l0l3Z342O3P

I see that this issue has been assigned as of two weeks ago, but has there been any movement? I'm happy to help if possible – and please let me know how I can. If not, we'll be moving off of the JSR-166 bundled with Scala and swapping deps for our OSS libraries shortly. This issue either needs to be fixed, or LTQ must replaced with the canonical JSR-166 implementation that does not exhibit this hazard.

– Scott

@scabug

This comment has been minimized.

Copy link
Author

commented Aug 22, 2012

C. Scott Andreas (cscotta) said:
We have since removed all dependencies upon scala.util.concurrent.forkjoin in all private and public libraries developed and published by the company.

– Scott

@scabug

This comment has been minimized.

Copy link
Author

commented May 20, 2013

@JamesIry said:
2.10.2 is about to be cut. Kicking down the road and un-assigning to foster work stealing.

@scabug

This comment has been minimized.

Copy link
Author

commented Jun 17, 2013

@soc said:
This seems to be fixed at least since 2.10.1 and 2.11 trunk. I guess the last forkjoin sync solved the issue.

Shall I close this issue or are there plans on backporting this to 2.9.x?

Andreas, could you comment?

@scabug

This comment has been minimized.

Copy link
Author

commented Jun 18, 2013

@gkossakowski said:
It would be great to get confirmation that this is indeed fixed in 2.10.1 so we can close this issue.

I don't think we could expect backport to 2.9.x.

@scabug scabug closed this Dec 9, 2013

@scabug scabug added the library label Apr 7, 2017

@scabug scabug added this to the 2.10.1 milestone Apr 7, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.