Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Blocker
-
Resolution: Unresolved
-
Affects Version/s: JRuby 1.4
-
Fix Version/s: JRuby 1.6.4
-
Component/s: Core Classes/Modules, Ruby 1.8.7, Ruby 1.9.2
-
Labels:None
-
Number of attachments :
Description
This bug is catching the remainder of the work from JRUBY-3964:
- When Enumerator thread creation gets ahead of GC for dead enumerators+threads, we must have a mechanism for choking the rate of creation of new enumerator threads. My proposed way would be to use a weak reference queue to actively tidy up old enumerators+threads in the logic to create a new one; this will slow down creation to the speed at which GCable threads can be cleaned up.
- When we reach a thread limit, we need to raise a nicer error. Right now the Java OOM error percolates out, killing the thread calling #next
- 1.9's threaded Fibers need to be made GCable like 1.8.7's threaded Generators are now (due to fixes made for 1.4).
Activity
Charles Oliver Nutter
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Affects Version/s | JRuby 1.4 [ 15285 ] | |
| Fix Version/s | JRuby 1.5 [ 15792 ] | |
| Fix Version/s | JRuby 1.4 [ 15285 ] |
Charles Oliver Nutter
made changes -
| Description |
Currently we spin up a thread for fibers, generators, and enumerators that have had next or rewind called on them. This works well functionally, but with a hard reference from the containing object to the created thread, we're creating a situation where even after the fiber/generator/enumerator has been dereferenced, it and anything it references will stay alive because of the spun-up thread. In addition, there are environments where it will be impossible to spin up threads, and we must produce a *friendly* error in those cases. Both issues need to be fixed for this bug, to ensure our use of threads fits as cleanly as possible into all server types. |
This bug is catching the remainder of the work from * When Enumerator thread creation gets ahead of GC for dead enumerators+threads, we must have a mechanism for choking the rate of creation of new enumerator threads. My proposed way would be to use a weak reference queue to actively tidy up old enumerators+threads in the logic to create a new one; this will slow down creation to the speed at which GCable threads can be cleaned up. * When we reach a thread limit, we need to raise a nicer error. Right now the Java OOM error percolates out, killing the thread calling #next * 1.9's threaded Fibers need to be made GCable like 1.8.7's threaded Generators are now (due to fixes made for 1.4). |
Charles Oliver Nutter
made changes -
| Fix Version/s | JRuby 1.6 [ 16275 ] | |
| Fix Version/s | JRuby 1.5 [ 15792 ] |
Charles Oliver Nutter
made changes -
| Fix Version/s | JRuby 1.6 [ 17062 ] | |
| Fix Version/s | JRuby 1.6RC1 [ 16275 ] |
Charles Oliver Nutter
made changes -
| Fix Version/s | JRuby 1.6.1 [ 17085 ] | |
| Fix Version/s | JRuby 1.6 [ 17062 ] |
Charles Oliver Nutter
made changes -
| Fix Version/s | JRuby 1.6.2 [ 17306 ] | |
| Fix Version/s | JRuby 1.6.1 [ 17085 ] |
Charles Oliver Nutter
made changes -
| Fix Version/s | JRuby 1.6.3 [ 17374 ] | |
| Fix Version/s | JRuby 1.6.2 [ 17306 ] |
Thomas E Enebo
made changes -
| Fix Version/s | JRuby 1.6.4 [ 17472 ] | |
| Fix Version/s | JRuby 1.6.3 [ 17374 ] |
This is a clone of the previous bug (
JRUBY-3964) to address a few additional points that were not critical enough for 1.4: