| Priority |
Critical |
| Type | Bug |
| State | Reopened |
| Assignee | Dmitry Neverov |
| Subsystem | Version Control: Git |
| Affected versions |
Calcutta 4.5.4 (9071)
|
| Fix for |
5.1.x, Eluru 6.0
|
|
|
Sorry for delay with replying.
Could you attach the server VCS logs covering the hanging and take a thread dump from the server during the hanging?
I am running git plugin version 1.0.0.pub-39-d65289d918c522208b976a6845cc1b05afc9e764
I am afraid we will need thread dump from the server process (the one you attached is from the agent).
Sorry about that, I forgot that the checkout was made on the server.
Have now attached tomcat.jstack.txt
I thought this issue was fixed there since TW-9611 was marked as fixed. And I thought that the "checking for changes" now had a timeout of 30 seconds but that is not the case. We still have hanging builds.
Do we have to set the system properties described here ? –> http://www.jetbrains.net/confluence/display/TW/Git
Also, this sshs:// connection in question is to localhost, so I am certain that there must also be an underlying issue too. There should not be any "timeouts" at all.
After TW-9611 there is a timeout. The defaults are stated on the plugin page (30 minutes by default for fetch)
It turns out that there are still some communication issues. Let's reopen the issue to address it (however, probably this is related to underlying library: jgit, not TeamCity Git integration)
One thing that I have noticed is that when builds are triggered either by a schedule or by someone pressing the "run" button, the build has a very high tendency to hang.
However, when builds are triggered via a push/pull ( ie. a new commit), then it works fine.
Also, once a VCS root has started to show this behaviour, it never starts working again. (new changes are never picked up )
We have encountered the same problems after upgrading TeamCity from 4.5 to 5.0.1 (Our Teamcity server runs on a Linux server)
We have not been able to do any builds at all with Teamcity 5.
I tested to do a new/clean install of Teamcity 4.5.6 + the GIT-plugin on a Windows machine - and it work without problems.
I tested to do a new/clean install of Teamcity 5.0.1 on a Windows machine - and it did fail.
So I think that something has happened when the plugin was integrated into Teamcity.
Question: Is it possible to in some way install/use the plugin into Teamcity 5.0.1 ?
No, our "production" Teamcity server is running on a Linux OS and is using a a PostgreSQL db.
and the additional tests I did on a computer running Windows were using the "internal" Teamcity db.
1. Please ensure you use the latest git plugin available, the hanging should be fixed there, but the connection will be terminated with a timeout in the case the condition reproduces.
2. The issue only reproduces with ssh protocol, so if possible, try using git or http.
this is even after having updated the git plugin to the latest version
When checking the logs i find the following information that indicates a deadlock
[2010-04-27 12:18:12,949] WARN - Server.util.NamedThreadFactory - Cached pool 18 at sun.misc.Unsafe.park(Native Method)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:747)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:778)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1114)
at java.util.concurrent.locks.ReentrantLock$NonfairSync.lock(ReentrantLock.java:186)
at java.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:262)
at jetbrains.buildServer.buildTriggers.vcs.VcsChangesLoader.lockChangesCollecting(VcsChangesLoader.java:144)
at jetbrains.buildServer.vcs.impl.VcsManagerImpl.lockChangesLoading(VcsManagerImpl.java:680)
at jetbrains.buildServer.vcs.impl.VcsManagerImpl.loadChanges(VcsManagerImpl.java:191)
at jetbrains.buildServer.serverSide.impl.auth.SecuredVcsManager.loadChanges(SecuredVcsManager.java:18)
at jetbrains.buildServer.vcs.impl.VcsChangesCollectorImpl$3.call(VcsChangesCollectorImpl.java:1)
at jetbrains.buildServer.vcs.impl.VcsChangesCollectorImpl$3.call(VcsChangesCollectorImpl.java)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Cached pool 6 at sun.misc.Unsafe.park(Native Method)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:747)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:778)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1114)
at java.util.concurrent.locks.ReentrantLock$NonfairSync.lock(ReentrantLock.java:186)
at java.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:262)
at jetbrains.buildServer.buildTriggers.vcs.VcsChangesLoader.lockChangesCollecting(VcsChangesLoader.java:144)
at jetbrains.buildServer.vcs.impl.VcsManagerImpl.lockChangesLoading(VcsManagerImpl.java:680)
at jetbrains.buildServer.vcs.impl.VcsManagerImpl.loadChanges(VcsManagerImpl.java:191)
at jetbrains.buildServer.serverSide.impl.auth.SecuredVcsManager.loadChanges(SecuredVcsManager.java:18)
at jetbrains.buildServer.vcs.impl.VcsChangesCollectorImpl$3.call(VcsChangesCollectorImpl.java:1)
at jetbrains.buildServer.vcs.impl.VcsChangesCollectorImpl$3.call(VcsChangesCollectorImpl.java)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Cached pool 15 at sun.misc.Unsafe.park(Native Method)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:747)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:778)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1114)
at java.util.concurrent.locks.ReentrantLock$NonfairSync.lock(ReentrantLock.java:186)
at java.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:262)
at jetbrains.buildServer.buildTriggers.vcs.VcsChangesLoader.lockChangesCollecting(VcsChangesLoader.java:144)
at jetbrains.buildServer.vcs.impl.VcsManagerImpl.lockChangesLoading(VcsManagerImpl.java:680)
at jetbrains.buildServer.vcs.impl.VcsManagerImpl.loadChanges(VcsManagerImpl.java:191)
at jetbrains.buildServer.serverSide.impl.auth.SecuredVcsManager.loadChanges(SecuredVcsManager.java:18)
at jetbrains.buildServer.vcs.impl.VcsChangesCollectorImpl$3.call(VcsChangesCollectorImpl.java:1)
at jetbrains.buildServer.vcs.impl.VcsChangesCollectorImpl$3.call(VcsChangesCollectorImpl.java)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Cached pool 17
then took the sources from http://teamcity.jetbrains.com/viewLog.html?guest=1&tab=artifacts&buildTypeId=bt152&buildId=lastSuccessful
and updated the jgit and jsch dependencies in the project. I attached the result as jetbrains.git.zip. Maybe it's useful for someone. I just deployed it on the server and so far it seems to work alright. Too early to tell if it fixed the issue tho
Here's a thread dump:
"12:50:23 Loading VCS changes for git@missarepo1:usd259.git#master {id=9}; Changes loader 3 {id=9}" group="main" prio=5 id=43 java.util.concurrent.locks.ReentrantLock$NonfairSync@8b071a
java.lang.Thread.State: WAITING at sun.misc.Unsafe.park(Native Method)
at java.util.concurrent.locks.LockSupport.park(Unknown Source)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(Unknown Source)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(Unknown Source)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(Unknown Source)
at java.util.concurrent.locks.ReentrantLock$NonfairSync.lock(Unknown Source) at java.util.concurrent.locks.ReentrantLock.lock(Unknown Source)
at jetbrains.buildServer.buildTriggers.vcs.VcsChangesLoader.lockChangesCollecting(VcsChangesLoader.java:77)
at jetbrains.buildServer.vcs.impl.VcsManagerImpl.lockChangesLoading(VcsManagerImpl.java:743)
at jetbrains.buildServer.vcs.impl.VcsManagerImpl.loadChanges(VcsManagerImpl.java:594)
at jetbrains.buildServer.serverSide.impl.auth.SecuredVcsManager.loadChanges(SecuredVcsManager.java:80)
at jetbrains.buildServer.serverSide.impl.VcsModificationChecker$1.run(VcsModificationChecker.java:10)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)
"Thread-3" group="main" prio=5 daemon id=13
java.lang.Thread.State: TIMED_WAITING at java.lang.Thread.sleep(Native Method)
at org.apache.log4j.helpers.FileWatchdog.run(FileWatchdog.java:103)
"12:52:01 http-8081-1 /admin/editVcsRoot.html?action=editVcsRoot " group="main" prio=5 daemon id=17 java.lang.Object@17f6b6d
java.lang.Thread.State: BLOCKED
at jetbrains.buildServer.buildTriggers.vcs.git.GitVcsSupport.testConnection(GitVcsSupport.java:1082)
at jetbrains.buildServer.controllers.admin.projects.EditVcsRootsController.doPost(EditVcsRootsController.java:107)
at jetbrains.buildServer.controllers.BaseFormXmlController$1.handleRequest(BaseFormXmlController.java:54)
at jetbrains.buildServer.controllers.AjaxRequestProcessor.processRequest(AjaxRequestProcessor.java:45)
at jetbrains.buildServer.controllers.BaseFormXmlController.doHandle(BaseFormXmlController.java:52)
at jetbrains.buildServer.controllers.BaseController.handleRequestInternal(BaseController.java:73)
at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:807)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.service(TeamCityDispatcherServlet.java:36)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at jetbrains.buildServer.web.SetThreadNameFilter.runChainWithModifiedThreadName(SetThreadNameFilter.java:8)
at jetbrains.buildServer.web.SetThreadNameFilter.doFilter(SetThreadNameFilter.java:26)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at jetbrains.buildServer.web.ResponseFragmentFilter.doFilter(ResponseFragmentFilter.java:5)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Unknown Source)
I pushed a build before I went home last night and came in this morning to a timeout error. I've attached the timeout error and threaddump.
[2010-06-21 13:33:02,130] WARN [loader 4 {id=6}] - jetbrains.buildServer.VCS - Error while loading changes for root git@reposerver:project.git#branchName {id=6}, cause: 'git fetch' command failed. stderr: Exception in thread "main" java.lang.NullPointerException: The factory must not be null
at org.eclipse.jgit.transport.SshTransport.setSshSessionFactory(SshTransport.java:99)
at jetbrains.buildServer.buildTriggers.vcs.git.GitVcsSupport.openTransport(GitVcsSupport.java:1286)
at jetbrains.buildServer.buildTriggers.vcs.git.GitVcsSupport.openTransport(GitVcsSupport.java:1267)
at jetbrains.buildServer.buildTriggers.vcs.git.Fetcher.fetch(Fetcher.java:64)
at jetbrains.buildServer.buildTriggers.vcs.git.Fetcher.main(Fetcher.java:42)
[2010-06-21 13:33:02,130] WARN [loader 2 {id=4}] - Triggers.vcs.git.GitVcsSupport - 'git fetch' command failed. stderr: Exception in thread "main" java.lang.NullPointerException: The factory must not be null
at org.eclipse.jgit.transport.SshTransport.setSshSessionFactory(SshTransport.java:99)
at jetbrains.buildServer.buildTriggers.vcs.git.GitVcsSupport.openTransport(GitVcsSupport.java:1286)
at jetbrains.buildServer.buildTriggers.vcs.git.GitVcsSupport.openTransport(GitVcsSupport.java:1267)
at jetbrains.buildServer.buildTriggers.vcs.git.Fetcher.fetch(Fetcher.java:64)
at jetbrains.buildServer.buildTriggers.vcs.git.Fetcher.main(Fetcher.java:42)
I took the lines back out of the internal.properties, restarted, and they picked back up. The few repos that it seems to be affecting the most don't change except weekly–and I can force a full clone on those as necessary for the time being until the jgit update works its way through.
Thanks!
I am using MS SQL 2008 server for storage.
I redownloaded (again) the jetbrains.git.zip provided by Dmitry, restarted the agent... and it seemed to pick it up that time and install it. It should then show up in Server Configuraiton > External Plugins as version 13456.
Since then (so far), the internal.properties settings provided seem to work just fine... and on the past few pushes, the repos are updating accordingly. As Dmitry pointed out, that should work until jgit is updated.
Thank you all for helping out!