[JIRA] (JENKINS-48867) Mercurial multibranch pipeline deletes all branches when repository is down

25 views
Skip to first unread message

alucard_tthu@hotmail.com (JIRA)

unread,
May 29, 2018, 9:35:02 AM5/29/18
to jenkinsc...@googlegroups.com
WynX Alucard commented on Bug JENKINS-48867
 
Re: Mercurial multibranch pipeline deletes all branches when repository is down

Recently I've also encountered this with a local mercurial server (mercurial-scm) not being available. Wiped all builds and branches, very problematic!

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

alucard_tthu@hotmail.com (JIRA)

unread,
May 29, 2018, 9:38:02 AM5/29/18
to jenkinsc...@googlegroups.com
WynX Alucard edited a comment on Bug JENKINS-48867
Recently I've also encountered this with a local mercurial server (mercurial-scm) not being available. Wiped all builds and branches, very problematic!


 

Jenkins v2.107.3 (current LTS)

Mercurial plugin v2.3

SCM API plugin 2.2.7

alucard_tthu@hotmail.com (JIRA)

unread,
May 29, 2018, 9:44:01 AM5/29/18
to jenkinsc...@googlegroups.com
WynX Alucard edited a comment on Bug JENKINS-48867
Recently I've also encountered this with a local mercurial server (mercurial-scm) not being available. Wiped all builds and branches, very problematic! Note that in my case the account used to access mercurial was (temporarily) blocked, resulting in the same behaviour.

 

Jenkins v2.107.3 (current LTS)

Mercurial plugin v2.3

SCM API plugin 2.2.7

dave@brewmook.com (JIRA)

unread,
Nov 9, 2018, 4:46:02 AM11/9/18
to jenkinsc...@googlegroups.com
Dave E commented on Bug JENKINS-48867

I got this too.

Short-term workaround, either of the following under "Orphaned Item Strategy":

  • Switch off "Discard old items" entirely, and take care of that by hand
  • Set positive number in "Max # of old items to keep"/"Days to keep old items".

Your mileage may vary depending on how often your Mercurial server goes down.

Having dug into this a bit, I believe the orphaned item stuff is behaving as expected.

The curious bit is the "Could not use caches, not fetching branch heads" error. Looking in MercurialSCMSource.java it simply returns if the cache is null. Should this not be throwing an exception instead? The knock-on effect seems to be that the orphaned item strategy kicks in and all the branches are marked as closed. I would expect the polling to abort entirely if the cache is not available/working.

This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

dave@brewmook.com (JIRA)

unread,
Nov 9, 2018, 4:48:02 AM11/9/18
to jenkinsc...@googlegroups.com
Dave E edited a comment on Bug JENKINS-48867
I got this too.

Short-term workaround, either of the following under "Orphaned Item Strategy":
* Switch off "Discard old items" entirely, and take care of that by hand
* Set positive number in "Max # of old items to keep"/"Days to keep old items".


Your mileage may vary depending on how often your Mercurial server goes down.

Having dug into this a bit, I believe the orphaned item stuff is behaving as expected.

The curious bit is the "Could not use caches, not fetching branch heads" error. Looking in [MercurialSCMSource.java| [https://github.com/jenkinsci/mercurial-plugin/blob/65ba1fe95fc95670a153a551b434d26365a0130c/src/main/java/hudson/plugins/mercurial/MercurialSCMSource.java #L211],] it simply returns if the cache is null. Should this not be throwing an exception instead? The knock-on effect seems to be that the orphaned item strategy kicks in and all the branches are marked as closed. I would expect the polling /indexing to abort entirely if the cache is not available/working.

dave@brewmook.com (JIRA)

unread,
Nov 9, 2018, 4:50:02 AM11/9/18
to jenkinsc...@googlegroups.com
Dave E commented on Bug JENKINS-48867

It doesn't help that the next consequence of this is a build storm when the mercurial server comes back up. All branches are marked as reopened and everything rebuilds. We currently have some issues with our hg server, and it reboots several times a week, so the build storms are proving to be the most frustrating consequence.

dave@brewmook.com (JIRA)

unread,
Nov 9, 2018, 5:09:02 AM11/9/18
to jenkinsc...@googlegroups.com
Dave E edited a comment on Bug JENKINS-48867
I got this too.

Short-term workaround, either of the following under "Orphaned Item Strategy":
* Switch off "Discard old items" entirely, and take care of that by hand
* Set positive number in "Max # of old items to keep"/"Days to keep old items".

Your mileage may vary depending on how often your Mercurial server goes down.

Having dug into this a bit, I believe the orphaned item stuff is behaving as expected.

The curious bit is the "Could not use caches, not fetching branch heads" error. Looking in [MercurialSCMSource.java| https://github.com/jenkinsci/mercurial-plugin/blob/65ba1fe95fc95670a153a551b434d26365a0130c/src/main/java/hudson/plugins/mercurial/MercurialSCMSource.java #L211], ] it simply returns if the cache is null. Should this not be throwing an exception instead? The knock-on effect seems to be that the orphaned item strategy kicks in and all the branches are marked as closed. I would expect the polling/indexing to abort entirely if the cache is not available/working.

dave@brewmook.com (JIRA)

unread,
Nov 9, 2018, 5:10:02 AM11/9/18
to jenkinsc...@googlegroups.com
Dave E edited a comment on Bug JENKINS-48867
I got this too.

Short-term workaround, either of the following under "Orphaned Item Strategy":
* Switch off "Discard old items" entirely, and take care of that by hand
* Set positive number in "Max # of old items to keep"/"Days to keep old items".

Your mileage may vary depending on how often your Mercurial server goes down.

Having dug into this a bit, I believe the orphaned item stuff is behaving as expected.

The curious bit is the "Could not use caches, not fetching branch heads" error. Looking in [MercurialSCMSource.java|https://github.com/jenkinsci/mercurial-plugin/blob/65ba1fe95fc95670a153a551b434d26365a0130c/src/main/java/hudson/plugins/mercurial/MercurialSCMSource.java#L211], it the retrieve methods simply returns if the cache is null. Should this not be throwing an exception instead? The knock-on effect seems to be that the orphaned item strategy kicks in and all the branches are marked as closed. I would expect the polling/indexing to abort entirely if the cache is not available/working.

hr.mohr@gmail.com (JIRA)

unread,
Apr 22, 2020, 10:41:03 AM4/22/20
to jenkinsc...@googlegroups.com
This issue also deleted my build history because of a temporary outage at a bad time.

I have opened a
[ PR |   [https://github.com/jenkinsci/mercurial-plugin/pull/144] ]   implementing the suggestion by [~brewmook]
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo

hr.mohr@gmail.com (JIRA)

unread,
Apr 22, 2020, 10:41:04 AM4/22/20
to jenkinsc...@googlegroups.com

This issue also deleted my build history because of a temporary outage at a bad time.

I have opened a [PR|https://github.com/jenkinsci/mercurial-plugin/pull/144] implementing the suggestion by Dave E

Reply all
Reply to author
Forward
0 new messages