Uploaded image for project: 'FishEye'
  1. FishEye
  2. FE-7330

Change command used to test connection against Mercurial repositories

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • None
    • Repositories
    • None
    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

    Description

      Issue Summary

      It would be nice to change the command used to test connection against Mercurial repositories to prevent a (false-positive) timeout during the repository set up. Fisheye is currently cloning the first changeset 0 in the Mercurial repository to a temporary folder in order to validate/ test the connection:

      hg --config ui.verbose=false clone -r 0 -e "/atlassian/apps/fisheye/bin/fe-ssh.sh" --noupdate ssh://your-mercurial-server/repository /atlassian/data/fisheye/var/tmp/hg_test_clone_1605702252133
      

      This works fine most part of the time unless the first changeset in the repository is big and takes over 60 seconds to clone. There's 60-second timeout imposed by Fisheye in the test connection process.

      Steps to Reproduce

      1. Connect to a Mercurial repository with a relatively big changeset # 0 (e.g. 10000 files added).
      2. Configure a Mercurial repository inside Fisheye and attempt a connection test.

      Expected Results

      Connection is successful because you are able to connect to the repository.

      Actual Results

      Test connection fails with the following errors:

      2020-11-18 12:24:12,145 DEBUG [qtp2073640037-375 xxx] fisheye DvcsProcessMonitor-onBeforeStart - Starting process: hg --config ui.verbose=false clone -r 0 -e "/atlassian/apps/fisheye/bin/fe-ssh.sh" --noupdate ssh://... /atlassian/data/fisheye/var/tmp/hg_test_clone_1605702252133
      2020-11-18 12:25:12,254 DEBUG [qtp2073640037-375 xxx] fisheye DvcsProcessMonitor-onAfterFinished - Finished process: hg --config ui.verbose=false clone -r 0 -e "/atlassian/apps/fisheye/bin/fe-ssh.sh" --noupdate ssh://... /atlassian/data/fisheye/var/tmp/hg_test_clone_1605702252133 took 60109ms
      ...
      2020-11-18 12:25:14,927 WARN  [qtp2073640037-375 xxx] fisheye IOHelper-recursiveDeleteImpl - problem deleting directory /atlassian/data/fisheye/var/tmp/hg_test_clone_1605702252133/.hg/store/data/...
      ...
      2020-11-18 12:25:14,966 ERROR [qtp2073640037-375 xxx] fisheye RepositoryAdminRpcServiceImpl-testRepositoryConnection - Error testing connection.
      
      com.atlassian.fisheye.spi.admin.services.RepositoryConfigException: com.cenqua.fisheye.config.ConfigException: Error talking to repository:
      
              at com.atlassian.fisheye.spi.admin.impl.DefaultRepositoryAdminService.testConnectionFor(DefaultRepositoryAdminService.java:966) [fisheye.jar:?]
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [?:1.8.0_265]
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [?:1.8.0_265]
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [?:1.8.0_265]
              at java.lang.reflect.Method.invoke(Method.java:498) [?:1.8.0_265]
              at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) [spring-aop-4.0.9.RELEASE.jar:4.0.9.RELEASE]
              at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190) [spring-aop-4.0.9.RELEASE.jar:4.0.9.RELEASE]
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) [spring-aop-4.0.9.RELEASE.jar:4.0.9.RELEASE]
              at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:85) [spring-aop-4.0.9.RELEASE.jar:4.0.9.RELEASE]
              at com.cenqua.crucible.hibernate.WithSessionAspect.doCloseSession(WithSessionAspect.java:56) [fisheye.jar:?]
              at sun.reflect.GeneratedMethodAccessor146.invoke(Unknown Source) [?:?]
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [?:1.8.0_265]
              at java.lang.reflect.Method.invoke(Method.java:498) [?:1.8.0_265]
              ...
      Caused by: com.cenqua.fisheye.config.ConfigException: Error talking to repository:
      
      
              at com.atlassian.fisheye.hg.HgScmConfig.testConnection(HgScmConfig.java:131) [fisheye.jar:?]
              at com.cenqua.fisheye.RepositoryConfig.testConnection(RepositoryConfig.java:390) [fisheye.jar:?]
              at com.atlassian.fisheye.spi.admin.impl.DefaultRepositoryAdminService.testConnectionFor(DefaultRepositoryAdminService.java:964) [fisheye.jar:?]
              ... 186 more
      Caused by: com.atlassian.utils.process.ProcessException: While executing: "hg --config ui.verbose=false clone -r 0 -e "/atlassian/apps/fisheye/bin/fe-ssh.sh" --noupdate ssh://... /atlassian/data/fisheye/var/tmp/hg_test_clone_1605702252133"
              at com.atlassian.fisheye.dvcs.DvcsScmConfig.executeCommand(DvcsScmConfig.java:142) [fisheye.jar:?]
              at com.atlassian.fisheye.hg.HgScmConfig.testConnection(HgScmConfig.java:125) [fisheye.jar:?]
              ... 188 more
      Caused by: com.atlassian.utils.process.ProcessTimeoutException: process timed out
              at com.atlassian.utils.process.ExternalProcessImpl.wrapUpProcess(ExternalProcessImpl.java:506) [atlassian-processutils-1.5.14.jar:?]
              at com.atlassian.utils.process.ExternalProcessImpl.finish(ExternalProcessImpl.java:423) [atlassian-processutils-1.5.14.jar:?]
              at com.atlassian.utils.process.ExternalProcessImpl.execute(ExternalProcessImpl.java:378) [atlassian-processutils-1.5.14.jar:?]
              at com.atlassian.fisheye.dvcs.DvcsScmConfig.executeCommand(DvcsScmConfig.java:139) [fisheye.jar:?]
              ... 189 more
      2020-11-18 12:25:15,004 ERROR [qtp2073640037-375 xxx] fisheye RepositoryAdminRpcServiceImpl-testRepositoryConnection - Connection failed.
      

      Notes

      This does not affect the indexing process for Mercurial repositories i.e. despite the connect test failure you should be able to add your Mercurial repository to Fisheye and start indexing. The 60-second timeout is only imposed for connection testing.

      Repository indexing is a different process and has a 60-minute timeout (default) as opposed to 60 seconds. Besides if the indexing process times out after 60 minutes (1 hour) it is possible to increase the timeout limits inside the repository configuration > SCM Details > Mercurial Options.

      Suggestion

      I'd suggest changing the command we use to test connection to a Mercurial repository to something lighter and less error prone to avoid this problem. We could use hg identify -r 0 instead of hg clone -r 0. The identify command will connect to the repository and get the commit number for the first changeset. This should be enough to test connection and make sure the user is able to access the repository without having to perform a test clone.

      Attachments

        Activity

          People

            Unassigned Unassigned
            brosa Bruno Rosa
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: