Skip to content

Commit d7a07b3

Browse files
authored
Merge branch 'master' into test-mount-paths
2 parents 672eacb + 2ec23f6 commit d7a07b3

File tree

32 files changed

+1226
-157
lines changed

32 files changed

+1226
-157
lines changed

.claude/skills/fix-flaky-tests/SKILL.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,12 @@ This guide explains how to find flaky tests to fix and how to debug them. Flaky
8282
and `<date>` with the current date in `YYYY-MM-DD` format,
8383
and commit your fix to that branch.
8484
85-
2. Submit a draft PR using `gh` with the fix.
85+
2. Push the branch to `origin` (assuming it's `git@github.com:dfinity/ic.git`) using:
86+
```
87+
git push --set-upstream origin HEAD
88+
```
89+
90+
3. Submit a draft PR using `gh` with the fix.
8691
Name it: `fix: deflake <label>`.
8792
Include the root cause analysis in the PR description
8893
and mention the PR was created following the steps in `.claude/skills/fix-flaky-tests/SKILL.md`.

.github/workflows/ci-kickoff-manual.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ jobs:
5454
commit-sha: ${{ inputs.commit-sha }}
5555
permissions:
5656
contents: read
57+
id-token: write
5758
pull-requests: read
5859

5960
ci-pr-only:

ic-os/components/misc/guestos-recovery/guestos-recovery-engine/guestos-recovery-engine.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ perform_recovery() {
122122
echo "Recovery artifacts applied successfully"
123123

124124
echo "Restarting services..."
125-
sudo systemctl restart setup-permissions || true
125+
sudo systemctl restart setup-permissions
126126

127127
echo "GuestOS recovery engine completed successfully"
128128
}

rs/ingress_manager/src/ingress_selector.rs

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,10 @@ impl IngressSelector for IngressManager {
196196
Ok(()) => (),
197197
Err(ValidationError::InvalidArtifact(
198198
InvalidIngressPayloadReason::IngressPayloadTooManyMessages(_, _),
199-
)) => break 'outer,
199+
)) => {
200+
self.metrics.observe_limit_reached("messages_count_limit");
201+
break 'outer;
202+
}
200203
_ => {
201204
queue.msgs.pop();
202205
continue;
@@ -206,9 +209,12 @@ impl IngressSelector for IngressManager {
206209
let size_estimates = self.message_size_estimates(&ingress.signed_ingress);
207210

208211
// Break criterion #1: global byte limit
209-
if accumulated_wire_size + size_estimates.wire > wire_byte_limit
210-
|| accumulated_memory_size + size_estimates.memory > memory_byte_limit
211-
{
212+
if accumulated_wire_size + size_estimates.wire > wire_byte_limit {
213+
self.metrics.observe_limit_reached("wire_byte_limit");
214+
break 'outer;
215+
}
216+
if accumulated_memory_size + size_estimates.memory > memory_byte_limit {
217+
self.metrics.observe_limit_reached("memory_byte_limit");
212218
break 'outer;
213219
}
214220

@@ -247,9 +253,12 @@ impl IngressSelector for IngressManager {
247253
}
248254
}
249255

250-
if wire_byte_limit <= accumulated_wire_size
251-
|| memory_byte_limit <= accumulated_memory_size
252-
{
256+
if wire_byte_limit <= accumulated_wire_size {
257+
self.metrics.observe_limit_reached("wire_byte_limit");
258+
// No remaining quota means the block is full. No more iterations needed.
259+
break;
260+
} else if memory_byte_limit <= accumulated_memory_size {
261+
self.metrics.observe_limit_reached("memory_byte_limit");
253262
// No remaining quota means the block is full. No more iterations needed.
254263
break;
255264
} else {
@@ -291,6 +300,7 @@ impl IngressSelector for IngressManager {
291300
wire_byte_limit.get()
292301
);
293302
messages_in_payload.pop();
303+
self.metrics.observe_limit_reached("serialized");
294304
if messages_in_payload.is_empty() {
295305
break IngressPayload::default();
296306
}
@@ -305,6 +315,7 @@ impl IngressSelector for IngressManager {
305315

306316
debug_assert!(size_estimates.wire <= wire_byte_limit);
307317
debug_assert!(size_estimates.memory <= memory_byte_limit);
318+
debug_assert!(payload.payload.message_count() <= settings.max_ingress_messages_per_block);
308319
payload
309320
}
310321

rs/ingress_manager/src/metrics.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ pub(crate) struct IngressManagerMetrics {
99
pub(crate) ingress_selector_get_payload_time: Histogram,
1010
pub(crate) ingress_selector_validate_payload_time: Histogram,
1111
pub(crate) ingress_payload_cache_size: IntGauge,
12+
limit_reached: IntCounterVec,
1213

1314
validated_ingress_message_size: Histogram,
1415
validated_ingress_message_field_size: HistogramVec,
@@ -62,6 +63,12 @@ impl IngressManagerMetrics {
6263
"The number of invalidated ingress messages, partitioned by the reason",
6364
&["reason"],
6465
),
66+
limit_reached: metrics_registry.int_counter_vec(
67+
"ingress_selector_limit_reached_total",
68+
"The total number of times we reached a limit while creating an ingress payload, \
69+
labeled by a type of the limit",
70+
&["limit_type"],
71+
),
6572
}
6673
}
6774

@@ -104,4 +111,8 @@ impl IngressManagerMetrics {
104111
.with_label_values(&["remainder"])
105112
.observe(everything_else_size as f64);
106113
}
114+
115+
pub(crate) fn observe_limit_reached(&self, limit_type: &str) {
116+
self.limit_reached.with_label_values(&[limit_type]).inc();
117+
}
107118
}

rs/nns/test_utils/src/itest_helpers.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,22 @@ pub async fn create_and_install_mock_exchange_rate_canister(
567567
install_mock_exchange_rate_canister(&mut mock_exchange_rate_canister, init_payload).await;
568568
}
569569

570+
/// Warning: This assumes that canisters with ID smaller than that of the
571+
/// Subnet Rental canister have all already been created.
572+
pub async fn create_and_install_mock_subnet_rental_canister(runtime: &'_ Runtime) -> Canister<'_> {
573+
// Create canisters in a loop until we hit SUBNET_RENTAL_CANISTER_ID.
574+
// This is a hack similar to the one in `create_and_install_mock_exchange_rate_canister`.
575+
// See the comment there for more details.
576+
for _ in 0..100 {
577+
let mut canister = runtime.create_canister(Some(0)).await.unwrap();
578+
if canister.canister_id() == SUBNET_RENTAL_CANISTER_ID {
579+
install_universal_canister(&mut canister).await;
580+
return canister;
581+
}
582+
}
583+
panic!("Could not set up mock subnet rental canister");
584+
}
585+
570586
/// Compiles the governance canister, builds it's initial payload and installs
571587
/// it
572588
pub async fn install_governance_canister(canister: &mut Canister<'_>, init_payload: Governance) {

0 commit comments

Comments
 (0)