Skip to content

Conversation

@shaohuzhang1
Copy link
Contributor

fix: Infinite loop increases maximum loop count limit

@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Sep 23, 2025

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Sep 23, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

max_loop_count = int((CONFIG.get("MAX_LOOP_COUNT") or 1000))


def _is_interrupt_exec(node, node_variable: Dict, workflow_variable: Dict):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Your function _is_interrupt_exec has a few minor improvements:

  1. Consistent Type Hinting: You added from collections import Dict, but since Python supports type hints natively with dictionaries like Dict[key_type, value_type], you can remove this line.

  2. Conversion to Integer: The conversion of CONFIG.get("MAX_LOOP_COUNT") to an integer is already done using (int()). This seems redundant and can be removed if the default value (1000) is also converted to an integer implicitly in Python.

Here's the revised code:

from maxkb.const import CONFIG
from django.utils.translation import gettext as _

max_loop_count = int(CONFIG.get("MAX_LOOP_COUNT", 1000))


def _is_interrupt_exec(node, node_variable: dict, workflow_variable: dict):

These changes improve readability slightly without introducing unnecessary complexity.

@shaohuzhang1 shaohuzhang1 merged commit b0509f7 into v2 Sep 23, 2025
4 of 5 checks passed
@shaohuzhang1 shaohuzhang1 deleted the pr@v2@fix_loop branch September 23, 2025 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants