• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mendersoftware / mender
76%
master: 80%

Build:
Build:
LAST BUILD BRANCH: pr_1828
DEFAULT BRANCH: master
Repo Added 16 Sep 2020 01:19PM UTC
Files 145
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

LAST BUILD ON BRANCH pr_1653
branch: pr_1653
CHANGE BRANCH
x
Reset
  • pr_1653
  • (HEAD detached at 4c17b4b)
  • (HEAD detached at 74712e5)
  • (HEAD detached at 968d41f)
  • (HEAD detached at c008bca)
  • (HEAD detached at ffef645)
  • 2.5.0-build2
  • 2.6.0-build1
  • 3.0.0-build1
  • 3.1.0-build3
  • 3.1.x
  • 3.2.0
  • 3.2.0-build2
  • 3.2.0-build4
  • 3.2.0-build7
  • 3.5.0-build6
  • 4.0.x
  • 5.0.x
  • HEAD
  • feature-client_auth_api
  • feature-partial_updates
  • feature-unified_comms
  • kacf-test
  • lluis-trigger-sync
  • master
  • pr_1613
  • pr_1618
  • pr_1621
  • pr_1622
  • pr_1623
  • pr_1624
  • pr_1625
  • pr_1626
  • pr_1627
  • pr_1629
  • pr_1630
  • pr_1631
  • pr_1632
  • pr_1633
  • pr_1634
  • pr_1635
  • pr_1636
  • pr_1637
  • pr_1638
  • pr_1639
  • pr_1640
  • pr_1641
  • pr_1642
  • pr_1643
  • pr_1644
  • pr_1645
  • pr_1646
  • pr_1647
  • pr_1648
  • pr_1649
  • pr_1650
  • pr_1651
  • pr_1652
  • pr_1654
  • pr_1655
  • pr_1656
  • pr_1657
  • pr_1658
  • pr_1659
  • pr_1660
  • pr_1661
  • pr_1662
  • pr_1663
  • pr_1664
  • pr_1666
  • pr_1667
  • pr_1668
  • pr_1669
  • pr_1670
  • pr_1671
  • pr_1672
  • pr_1673
  • pr_1674
  • pr_1675
  • pr_1676
  • pr_1677
  • pr_1678
  • pr_1679
  • pr_1680
  • pr_1681
  • pr_1682
  • pr_1683
  • pr_1684
  • pr_1685
  • pr_1686
  • pr_1687
  • pr_1688
  • pr_1689
  • pr_1690
  • pr_1691
  • pr_1692
  • pr_1693
  • pr_1694
  • pr_1695
  • pr_1696
  • pr_1697
  • pr_1698
  • pr_1699
  • pr_1700
  • pr_1701
  • pr_1702
  • pr_1704
  • pr_1705
  • pr_1706
  • pr_1707
  • pr_1709
  • pr_1710
  • pr_1711
  • pr_1712
  • pr_1713
  • pr_1714
  • pr_1715
  • pr_1716
  • pr_1717
  • pr_1718
  • pr_1719
  • pr_1721
  • pr_1722
  • pr_1723
  • pr_1724
  • pr_1725
  • pr_1726
  • pr_1727
  • pr_1728
  • pr_1729
  • pr_1730
  • pr_1731
  • pr_1733
  • pr_1734
  • pr_1735
  • pr_1736
  • pr_1737
  • pr_1738
  • pr_1739
  • pr_1740
  • pr_1742
  • pr_1743
  • pr_1744
  • pr_1745
  • pr_1746
  • pr_1747
  • pr_1748
  • pr_1749
  • pr_1751
  • pr_1752
  • pr_1753
  • pr_1754
  • pr_1755
  • pr_1756
  • pr_1757
  • pr_1759
  • pr_1760
  • pr_1761
  • pr_1762
  • pr_1763
  • pr_1764
  • pr_1765
  • pr_1766
  • pr_1767
  • pr_1769
  • pr_1770
  • pr_1771
  • pr_1772
  • pr_1773
  • pr_1774
  • pr_1775
  • pr_1776
  • pr_1777
  • pr_1778
  • pr_1779
  • pr_1780
  • pr_1781
  • pr_1782
  • pr_1785
  • pr_1786
  • pr_1787
  • pr_1790
  • pr_1792
  • pr_1793
  • pr_1795
  • pr_1796
  • pr_1798
  • pr_1799
  • pr_1801
  • pr_1802
  • pr_1803
  • pr_1805
  • pr_1806
  • pr_1807
  • pr_1808
  • pr_1809
  • pr_1810
  • pr_1811
  • pr_1812
  • pr_1813
  • pr_1814
  • pr_1815
  • pr_1816
  • pr_1817
  • pr_1820
  • pr_1821
  • pr_1822
  • pr_1823
  • pr_1824
  • pr_1825
  • pr_1826
  • pr_1827
  • pr_1828
  • v0.0.3

09 Aug 2024 11:38AM UTC coverage: 75.684%. Remained the same
1407203572

push

gitlab-ci

kacf
fix: Fix systemd race condition when restarting mender.

Although somewhat rare, it seems to have more than 50% chance of
happening at least once in one of the state script tests of an
integration test run. What's happening is that when running `systemctl
restart mender-updated` from an `ArtifactReboot` script, systemd kills
the whole control group, including the script. This is fine in itself,
but if the script happens to terminate before Mender does, then it
will be recorded as an error, and the Mender will start on its error
path. What happens afterwards depends on how far it gets before it is
also killed. Usually it will not get further than executing the first
`ArtifactReboot_Error` script, but it could potentially go all the way
to a rollback. Either of those is wrong.

The issue won't affect users of `rootfs-image`, since it uses
`NeedsArtifactReboot=Automatic`, which doesn't call the update
module's `ArtifactReboot`, but it can affect other means of running
`ArtifactReboot`, such as restarting it with systemctl after a package
upgrade.

The best way to mitigate this is to make sure the script survives
longer than Mender. This can be done in the script itself with a shell
`trap` or similar, since systemd sends SIGTERM first. But in order to
make this less surprising for users, switch systemd to kill the client
first in all cases, leaving scripts to be killed only if the
termination times out and it has to resort to SIGKILL.

This started appearing with Yocto scarthgap, and why it has appeared
now is anyone's guess, it could be multiple reasons:
* Exact killing pattern of systemd might have changed slightly.
* The new kernel might kill processes in the same control group
  slightly differently.
Whatever the reason, it causes the script to sometimes terminate
before Mender, causing the issue.

Changelog: Fix systemd race condition when restarting mender from
`ArtifactReboot` script. The symptom would be an error message like:
```
Process returned... (continued)

7109 of 9393 relevant lines covered (75.68%)

11607.37 hits per line

Relevant lines Covered
Build:
Build:
9393 RELEVANT LINES 7109 COVERED LINES
11607.37 HITS PER LINE
Source Files on pr_1653
  • Tree
  • List 141
  • Changed 21
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
1407203572 pr_1653 fix: Fix systemd race condition when restarting mender. Although somewhat rare, it seems to have more than 50% chance of happening at least once in one of the state script tests of an integration test run. What's happening is that when running `s... push 09 Aug 2024 11:54AM UTC kacf gitlab-ci
75.68
1402534905 pr_1653 fix: Fix crash when Sync_Leave returns error during a deployment. The problem is that once we have entered the `sync_leave_download` internal state, a deployment has started, and a deployment always has to be ended, to properly clean up. This is ... push 06 Aug 2024 11:48AM UTC kacf gitlab-ci
75.68
See All Builds (2057)
  • Repo on GitHub
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc