P2D2::Runaway CPU on Update

Issue #196 resolved
Ryan Powell created an issue

After I pushed a change set from a working copy to the Master repository, I ran Update on the Master to bring the files up to date. I have a hook in the update command to run a script to upload the changes to the server. It was at this point that the CPU usage went to %120-%150 and stayed there until I quit the application. (Note that the application did not hang; it was still somewhat responsive to commands and I was able to quit normally—no force quit.) Attached is a sample of the process while it was churning.

I'm running MacHg 0.9.14 d9af1d818c0c (I did not see this behavior when updating on the previous version)

Comments (20)

  1. Jason Harris repo owner

    First thanks for reporting this and helping me track this issue down...

    Can I get you to

    1. set logging to "All Generated HG Commands" in the MacHg preferences advanced tab.
    2. When the process starts throttling send me the log /tmp/MacHgTransactionLog

    Also can you reproduce this after say restarting. Ie do you have a reproducible case which throttles the CPU?

    Thanks, Jason

  2. Former user Account Deleted

    I've made several attempts, but have been unable to reproduce the issue. I have set logging to all commands, so I can grab that if I encounter it again.

  3. Olivier Larivain

    I've had the same problem with 0.9.14 recently. Sounds like the one that you thought was fixed with 0.9.13, doesn't it? Attached is the sample taken through activity monitor.

    What I was doing at the time: - local repo selected in machg - opened eclipse, imported project from local repo (ie: import existing maven project) - eclipse imported projects, recognized a mercurial repo, created it's .project etc, built the projet (meaning creation of target folder and a gazillion files in it) - a few seconds after import was done, machg went crazy on cpu.

    The repo is a local one, cloned from a perforce repo through perfarce extension. My .hgrc has a bunch of ignore for all maven/eclipse related files I never want to see in my repos. Hope that'll help.

    I've never been able to reproduce the problem, it happens every once in a while. It does seem (strong emphasis on seem) to happen when eclipse is modifying the files in the repo (ie synchronize or update project files). Never happened after a command line maven build, always just after importing/refreshing/doing something in eclipse.

  4. Moritz Lichter

    Experiences the same problem. I have the same output as Thomas Traub / tomcode. I am using version 0.9.16.

  5. Ryan Powell reporter

    Unfortunately, I encountered the same issue after updating to 0.9.18.

    Attached is the sample from Activity Monitor and all of the generated log commands (note that it appears there are no more commands written after the runaway CPU. The last entry was 2011-03-29 14:16:16, which was around the time the CPU started racing).

  6. Thomas Traub


    MacHg 0.9.19 cfc3d3a8208b

    Me too, I got a runaway CPU after an update.

    What I had done :

    • cloned a local repo
    • added some files using ditto
    • searched for a 'delete uncommitted files'
    • found nothing, came up with the idea to delete all files (exept .hg stuff) and then just update
    • did so with 'clean' checked
    • clicked the button options in the pop-up confirmation dialog
    • got the oups sound while returning to the update dialog
    • repeated the update, this time clicking update in the pop-up confirmation
    • the runaway started, I quit MacHg Tried in vain to reproduce it.

    the looped log entries in system.log Apr 9 13:33:00 Thomas-Traubs-MacBook-Pro [0x0-0x2c12c1].com.jasonfharris.MachHg[7778]: 2011-04-09 13:33 MacHg[7778] (CarbonCore.framework) Apr 9 13:33:00 Thomas-Traubs-MacBook-Pro [0x0-0x2c12c1].com.jasonfharris.MachHg[7778]: process_dir_events: kevent returned -1 (Bad file descriptor) Apr 9 13:33:00 Thomas-Traubs-MacBook-Pro [0x0-0x2c12c1].com.jasonfharris.MachHg[7778]: 2011-04-09 13:33 MacHg[7778] (CarbonCore.framework) process_dir_events: kevent returned -1 (Bad file descriptor)

  7. Thomas Traub

    Today I got again a runaway CPU

    I had MacHg open (since I had restarted it 19 hours ago, see above comment) with the project file, but I did not do anything in MacHg. I added the HTML file delorie.htm to the project's root, a minute or so later the runaway started again. The system's log showed the same lines as before.

    See attached screen

  8. Jason Harris repo owner

    Yeah, it still looks like somehow the FSEvents are getting messed up. (But I knew this before hand.) I am about to make another change to the NSTask calling model... This might fix this, but I am not sure...

    But thanks for the reports!!

    Cheers, Jas

  9. Jason Harris repo owner

    Can you upgrade to MacHg 0.9.20 and retest this. In fact can anyone reproduce this in MacHg 0.9.20?

  10. Jason Harris repo owner

    Whew! This should *really* now be fixed in MacHg 0.9.21. (The change to TLMTask should fix this.)

    Thanks, Jason

  11. Former user Account Deleted

    I experience this with 0.9.23. It happens frequently if I'm editing the files that are in a repository MacHG is managing and I leave it open in the background.

  12. Ulf Söderberg

    I have also seen this behaviour a couple of times with 0.9.23 while MacHg was open and I edited some files.

  13. Log in to comment