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

Future hangs when it probably shouldn't #9831

Closed
scabug opened this issue Jun 25, 2016 · 2 comments
Closed

Future hangs when it probably shouldn't #9831

scabug opened this issue Jun 25, 2016 · 2 comments

Comments

@scabug
Copy link

scabug commented Jun 25, 2016

This is related to Bug #9830, which in fact derives from this. This is the code

import scala.concurrent._
import ExecutionContext.Implicits.global
val f: Future[Int] = Future {
val source = scala.io.Source.fromChars(("x" * 7000000).toArray)
source.toSeq.indexOfSlice("teetotal")
}

Per the referenced bug, the stuff inside the Future {...} never completes, so of course the future never returns; typing 'f' in the REPL brings up this:

res0: scala.concurrent.Future[Int] = List()

because it's unfinished. What's odd is if you type 'f' a few more times, it returns the same "I'm not finished" result ever more slowly, and after ~15 seconds it stops returning anything at all.
IOW it seems the thread that spawns the future is hanging. The computing thread is taking up near 100% of cpu but not all of it (rest of my machine is fairly responsive) so the spawning thread has enough cpu to reply to my entering 'f', but it locks up.
Should this happen?

@scabug
Copy link
Author

scabug commented Jun 25, 2016

Imported From: https://issues.scala-lang.org/browse/SI-9831?orig=1
Reporter: ImNotTellingYouThat (intyt)
Affected Versions: 2.11.8
See #9830

@scabug
Copy link
Author

scabug commented Aug 10, 2016

@SethTisue said:
See my remarks on #9830. Start in other fora, come to JIRA once you're sure there's a bug and specifically where the bug is.

@scabug scabug closed this as completed Aug 10, 2016
@scabug scabug added the needinfo label Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant