<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>13235</bug_id>
          
          <creation_ts>2019-03-25 11:42:59 +0000</creation_ts>
          <short_desc>Document parallel fetch task limitation configuration option</short_desc>
          <delta_ts>2022-03-16 15:45:52 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>BitBake</product>
          <component>bitbake</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>minor</bug_severity>
          <target_milestone>4.0</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Chris Isbell">chris.isbell</reporter>
          <assigned_to name="Michael Opdenacker">michael.opdenacker</assigned_to>
          <cc>michael.opdenacker</cc>
    
    <cc>mostthingsweb</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>srifenbark</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Yes (doc changes required)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>83310</commentid>
    <comment_count>0</comment_count>
    <who name="Chris Isbell">chris.isbell</who>
    <bug_when>2019-03-25 11:42:59 +0000</bug_when>
    <thetext>Problem:

Bitbake reports the following error when accessing git repositories over ssh:

ssh_exchange_identification: Connection closed by remote host
fatal: Could not read from remote repository.

The repository that fails changes between builds, and some builds succeed. There is no obvious pattern.

The command &quot;bitbake package-index&quot; was especially prone to failure.

Root Cause:

The builds were being performed on a 24 core processor and Bitbake was starting multiple parallel ssh sessions to access repositories held on an Ubuntu 16.04LTS server on the same LAN.

Builds worked on a 4 core processor.

By default, the ssh server is configured to reject too many parallel sessions from the same host, with a default value of ten sessions.

Partial Solution:

Update the configuration on the git server to allow more parallel sessions.

Edit /etc/ssh/sshd_conf and add lines similar to the following:

MaxSessions 30
MaxStartups 30:60:90

(Only one of these lines may be necessary.)

Suggested Solution:

Bitbake should limit the total number of parallel connections to repositories to a reasonable default value, with the option for user to override this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83354</commentid>
    <comment_count>1</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2019-03-28 14:45:14 +0000</bug_when>
    <thetext>You can limit the number of fetch tasks using:

http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=a0cb1021c04c37b972bbf3d3626c7eef8a9876d1

We don&apos;t normally see this issue as we don&apos;t have multiple ssh connections to git repos in our default builds. Where you have a large number of projects on a local server like in a software stack development environment, you would see this though and I guess this is what you&apos;re seeing.

We also don&apos;t want to limit to say 4 fetch processes by default as this would impact performance on multicore builds where the majority of the source is present.

We should therefore perhaps add a commented out version of this to local.conf.sample and put more information in the manual about this. Adding Scott to see if we can do that.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83393</commentid>
    <comment_count>2</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2019-04-01 20:35:17 +0000</bug_when>
    <thetext>Hi, 

I have a candidate section in the BitBake User Manual where we might consider noting this information - see https://www.yoctoproject.org/docs/2.7/bitbake-user-manual/bitbake-user-manual.html#the-download-fetch.  I think we could update that section to provide information on this issue.

Part of that previous section is the section specific to the the Git Fetcher (https://www.yoctoproject.org/docs/2.7/bitbake-user-manual/bitbake-user-manual.html#git-fetcher).  Would it be better to call out the behavior here instead of the higher level section?

Additionally, this area in the overview &amp; concepts manual talks about getting source files (https://yoctoproject.org/docs/2.7/overview-manual/overview-manual.html#sources-dev-environment).  Do you think it is useful to mention this behavior here?  Or, at least note it and point to the BB manual?

Another question for me.. Is this problem limited to Git repos only? Or, are other SCMs affected? And, it appears to be only SSH? 

Thanks,
Scott</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83406</commentid>
    <comment_count>3</comment_count>
    <who name="Chris Isbell">chris.isbell</who>
    <bug_when>2019-04-02 08:50:35 +0000</bug_when>
    <thetext>Hi

Having a commented out option in local.conf.sample would be helpful for naive users (like me).

I am using URLs of the form: &quot;git://git@server/some_repo;protocol=ssh&quot;

(The server is using Gitolite, which is configured to use ssh keys for access control.)

Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83562</commentid>
    <comment_count>4</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2019-04-16 23:58:37 +0000</bug_when>
    <thetext>Hi, 

Any comment on my possible documentation solutions mentioned in Comment 2?  Is the commented out option in local.conf.sample sufficient?

Thanks,
Scott</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85382</commentid>
    <comment_count>5</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2019-10-17 17:02:45 +0000</bug_when>
    <thetext>Hi, 

Any feedback on my Comment 2?  I can implement that.

Thanks,
Scott</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86117</commentid>
    <comment_count>6</comment_count>
    <who name="Chris Laplante">mostthingsweb</who>
    <bug_when>2020-01-24 20:26:59 +0000</bug_when>
    <thetext>FYI another cause of this is a firewall/IPS that detects lots of ssh sessions as an SSH brute force. One workaround is to use SSH multiplexing, e.g. https://www.cyberciti.biz/faq/linux-unix-reuse-openssh-connection/.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86494</commentid>
    <comment_count>7</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2020-02-19 21:45:00 +0000</bug_when>
    <thetext>The configuration applies generically to fetch tasks in total, not any specific protocol. I&apos;ve queued a patch addin a section to local.conf.samople.extended. I&apos;m going to reassign to Mark to take the manual pieces further, it probably belongs in a higher level documentation section rather than protocol specific.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86764</commentid>
    <comment_count>8</comment_count>
    <who name="Mark Morton">mark.morton</who>
    <bug_when>2020-03-20 16:21:34 +0000</bug_when>
    <thetext>After reading the comments, I&apos;m not really sure what to document here. It seems like we want to provide a workaround if someone experiences this issue, but is there anything else to add?

Any feedback on Scott&apos;s suggestions, or are we looking for something new altogether?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>92748</commentid>
    <comment_count>9</comment_count>
    <who name="Michael Opdenacker">michael.opdenacker</who>
    <bug_when>2022-03-09 16:05:07 +0000</bug_when>
    <thetext>Sent a documentation patch to address this issue:
https://lists.yoctoproject.org/g/docs/message/2558</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>92782</commentid>
    <comment_count>10</comment_count>
    <who name="Michael Opdenacker">michael.opdenacker</who>
    <bug_when>2022-03-16 15:45:52 +0000</bug_when>
    <thetext>Fixed by this addition to the Yocto Project manual:
https://git.yoctoproject.org/yocto-docs/commit/?h=master-next&amp;id=cf76420c50f13762fb800a19931a8af5ae3567cf</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>