Skip to content

about the function get_deepth_pod #10

@Shenyyyyyyyyyy

Description

@Shenyyyyyyyyyy

Hello,

I noticed in the data_integrate.py file there is a function get_deepth_pod with many levels of loops, and it gets stuck in an infinite loop when the flag is true. I didn't understand the purpose of this function; could you please explain its functionality and under what scenarios it would result in an infinite loop?

def get_deepth_pod(self, traget_event):
        pod = ""
        deepth = 0
        while True:
            flag = False
            for key in self.adjacency_list.keys():
                for item in self.adjacency_list[key]:
                    if traget_event == item.event:
                        traget_event = key.event
                        if deepth == 0:
                            pod = item.pod
                        flag = True
                        if "start" in key.event and "TraceID" not in key.event:
                            deepth = deepth + 1
                        break
                if flag == True:
                    # break
                    return deepth, pod
            if flag == False:
                break
        return deepth, pod

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions