New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.
Starred by 5 users

Issue metadata

Status: Released
Last visit 29 days ago
Closed: Apr 2018

Sign in to add a comment

Issue 8742: Infinite busy loop in IntraLineLoader.combineLineEdits

Reported by, Apr 12 2018

Issue description

Affected Version: 2.15.1

What steps will reproduce the problem?
Not sure exactly.

What is the expected output?
Gerrit shouldn't be pegging the CPU all the time

What do you see instead?
Gerrit is pegging all the available cores all the time

Please provide any additional information below.

I'm seeing a bunch of threads that all look like this one:

"Diff-65" #699 daemon prio=5 os_prio=0 tid=0x00007fd1e803b800 nid=0x5c69 runnable [0x00007fd2cf9f8000]
   java.lang.Thread.State: RUNNABLE
        at$$Lambda$383/ Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(
        at java.util.concurrent.ThreadPoolExecutor$

   Locked ownable synchronizers:
        - <0x00000005cf808200> (a java.util.concurrent.ThreadPoolExecutor$Worker)

They are constantly running and causing Gerrit to peg all available cores nonstop.  Looking at the code briefly I noticed that this is in a for loop that only conditionally increments the iterator "j".  It seems to me like the loop can potentially busy loop if "j++" never gets executed for some reason.

This change in 2.15.1 looks like it could be the cause:

+      if (editsDueToRebase.contains(c) || editsDueToRebase.contains(n)) {
+        // Don't combine any edits which were identified as being introduced by a rebase as we would
+        // lose that information because of the combination.
+        continue;
+      }

Not sure though, I'm not familiar with Gerrit's code and it's the first time I look at this particular part of the code.  Just a hunch.

Comment 1 by, Apr 12 2018

Project Member
Components: -PolyGerrit Backend

Comment 2 by, Apr 13 2018

Project Member
Status: Started (was: New)
You're right. It's an infinite loop. The test which should have caught this also has a bug. :-(

Comment 3 by, Apr 13 2018

Project Member
Status: ChangeUnderReview (was: Started)

What I forgot previously: Thank you for the bug report. It helped a lot.

Comment 4 by, Apr 13 2018

Labels: FixedIn-2.15.2
Status: Submitted (was: ChangeUnderReview)

Comment 5 by, Apr 17 2018

Project Member
Labels: Performance

Comment 6 by, May 23 2018

Hi guys,
Just checking in on what's the ETA for 2.15.2 to get this fix out, we hit it almost daily and I'm trying to decide whether I wait for the release or roll out a build of the the stable-2.15 branch.  Thanks!

Comment 7 by, May 26 2018

Deployed the release today, thanks!

Comment 8 by, Aug 30

Project Member
 Issue 9085  has been merged into this issue.

Comment 9 by, Aug 30

Project Member
Status: Released (was: Submitted)

Sign in to add a comment