Skip to content

Conversation

@st3v3nmw
Copy link
Member

@st3v3nmw st3v3nmw commented Dec 2, 2025

While working on the device management manager (wonder how much it'll cost to name that manager 😄), I encountered a situation where I needed to use task lanes but they weren't documented in our trusty README.md. This PR does just that: documents task lanes. If something's off, please let me know.

Task lanes example from the `deviceMgmtMgr`

Example: Message Processing Without Lanes

When message C7NFJDFXZGR7XBOF fails, message JMAI5MYPI2GDUD7V's queue-response task is held:

$ snap tasks <ch-id-1>
Status  Summary
Done    Exchange messages with the Store
Done    Dispatch message(s) to subsystems
Done    Validate message C7NFJDFXZGR7XBOF
Error   Apply message C7NFJDFXZGR7XBOF
Hold    Queue response for message C7NFJDFXZGR7XBOF
Done    Validate message JMAI5MYPI2GDUD7V
Done    Apply message JMAI5MYPI2GDUD7V
Hold    Queue response for message JMAI5MYPI2GDUD7V  ← blocked despite success

----

Apply message C7NFJDFXZGR7XBOF

ERROR cannot apply message: cannot find view "accesss-wifi" in confdb schema <account>/network

Example: Message Processing With Lanes

Message HAWD4UTZVVRF4WKX completes and queues its response while message MYK2FJKMVWTBEC76 fails independently:

$ snap tasks <ch-id-2>
Status  Summary
Done    Exchange messages with the Store
Done    Dispatch message(s) to subsystems
Done    Validate message HAWD4UTZVVRF4WKX
Done    Apply message HAWD4UTZVVRF4WKX
Done    Queue response for message HAWD4UTZVVRF4WKX  ← queued successfully
Done    Validate message MYK2FJKMVWTBEC76
Error   Apply message MYK2FJKMVWTBEC76
Hold    Queue response for message MYK2FJKMVWTBEC76

----

Apply message MYK2FJKMVWTBEC76

ERROR cannot apply message: cannot find view "accesss-wifi" in confdb schema <account>/network

@st3v3nmw st3v3nmw added the Simple 😃 A small PR which can be reviewed quickly label Dec 2, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds documentation for task lanes in the overlord's README, explaining how lanes enable independent failure domains within a Change.

Key Changes:

  • Documents the default behavior where any task failure aborts the entire change
  • Explains how lanes allow partial failure by grouping tasks into independent domains
  • Describes lane assignment using JoinLane() and NewLane(), and the special lane 0 for unassigned tasks

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


To assign a `Task` to a lane, use `Task.JoinLane()` where the lane number is obtained from `State.NewLane()`. A `Task` can be in multiple lanes by calling `JoinLane` multiple times. `Task`s not explicitly assigned to any lane are considered to be in lane 0.

When a `Task` in a lane fails, `Change.AbortLanes` aborts all `Task`s exclusively in that lane and any `Task`s waiting on them. However, `Task`s that belong to multiple lanes survive if at least one of their other lanes is healthy i.e., all of the lane's `Task`s are in Do, Doing, or Done status.
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The phrase 'i.e.' should be preceded by a comma for proper punctuation.

Suggested change
When a `Task` in a lane fails, `Change.AbortLanes` aborts all `Task`s exclusively in that lane and any `Task`s waiting on them. However, `Task`s that belong to multiple lanes survive if at least one of their other lanes is healthy i.e., all of the lane's `Task`s are in Do, Doing, or Done status.
When a `Task` in a lane fails, `Change.AbortLanes` aborts all `Task`s exclusively in that lane and any `Task`s waiting on them. However, `Task`s that belong to multiple lanes survive if at least one of their other lanes is healthy, i.e., all of the lane's `Task`s are in Do, Doing, or Done status.

Copilot uses AI. Check for mistakes.
@codecov
Copy link

codecov bot commented Dec 2, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.52%. Comparing base (1794fee) to head (608eb92).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #16331      +/-   ##
==========================================
+ Coverage   77.47%   77.52%   +0.05%     
==========================================
  Files        1332     1327       -5     
  Lines      182307   182264      -43     
  Branches     2437     2437              
==========================================
+ Hits       141234   141309      +75     
+ Misses      32502    32385     -117     
+ Partials     8571     8570       -1     
Flag Coverage Δ
unittests 77.52% <ø> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions
Copy link

github-actions bot commented Dec 2, 2025

Wed Dec 3 18:47:35 UTC 2025
The following results are from: https://github.com/canonical/snapd/actions/runs/19864141608

Failures:

Preparing:

  • garden:ubuntu-22.04-64:
  • openstack-ps7:ubuntu-22.04-64:tests/main/nvidia-files:450_server
  • openstack-ps7:ubuntu-16.04-64:null:snapd_cgroup_just_inside
  • openstack-ps7:ubuntu-18.04-64:null

Executing:

  • openstack:debian-sid-64:tests/unit/go:static
  • openstack:debian-sid-64:tests/unit/go:clang
  • openstack:debian-sid-64:tests/main/degraded
  • openstack:debian-sid-64:tests/main/auto-refresh-pre-download:close
  • openstack:debian-sid-64:tests/main/interfaces-network-status-classic
  • openstack:fedora-41-64:tests/main/degraded
  • openstack:fedora-42-64:tests/main/mix-revision-and-channel
  • openstack:fedora-41-64:tests/main/component-sideload
  • openstack-arm-ps7:ubuntu-core-24-arm-64:tests/core/kernel-base-gadget-pair-single-reboot-failover:kernel_gadget
  • openstack-arm-ps7:ubuntu-core-24-arm-64:tests/main/dbus-activation-name-conflict
  • garden:ubuntu-core-18-64:tests/core/gadget-kernel-refs-update-pc
  • openstack-ps7:ubuntu-core-22-64:tests/core/services
  • openstack-ps7:ubuntu-25.10-64:tests/unit/go:clang
  • openstack-ps7:ubuntu-24.04-64:tests/main/cwd
  • openstack-ps7:ubuntu-24.04-64:tests/main/cgroup-tracking:test
  • openstack-ps7:ubuntu-16.04-64:null:func

Restoring:

  • openstack-arm-ps7:ubuntu-core-24-arm-64:tests/core/kernel-base-gadget-pair-single-reboot-failover:kernel_gadget
  • openstack-arm-ps7:ubuntu-core-24-arm-64:tests/core/
  • openstack-arm-ps7:ubuntu-core-24-arm-64:
  • openstack-ps7:ubuntu-25.10-64:tests/main/lxd:snapd_cgroup_just_outside
  • openstack-ps7:ubuntu-18.04-64:null

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Simple 😃 A small PR which can be reviewed quickly

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant