Skip to content

fix bug of duplicated dataset namespace #578

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main-1.x
Choose a base branch
from

Conversation

liouxiao
Copy link

@liouxiao liouxiao commented Aug 2, 2024

we are using Fate 1.11 with dsl_version = 2, and find the namespaces of different hosts are always same - although we use different name for them.

For example, we have 2 hosts - "host1" (with dataset "ns1"), "host2" (with dataset "ns2"), but the dashboard shows both hosts' datasets as "ns2".

The issue is caused by RuntimeConfParserV2.get_input_parameters() -

input_parameters[role] = [copy.deepcopy(cpn_dict)] * len(submit_dict["role"][role])
, or https://github.com/FederatedAI/FATE-Flow/blob/dev-1.11.2/python/fate_flow/utils/runtime_conf_parse_util.py#L518

the elements of input_parameters[role] all refer to the same object!

Look at these example:

a = [{}] * 2
a[0]['key'] = 'value'
print(a)
print(id(a[0]))
print(id(a[1]))

the output is:

[{'key': 'value'}, {'key': 'value'}]
1925659892800
1925659892800

both a[0] and a[1] are actually the same object.

The solution is to replace the assignment with "List Comprehensions", like:

a = [{} for _ in range(2)]

@liouxiao liouxiao force-pushed the bugfix_duplicated_dataset_namespace branch from 67ce3c6 to ca0d146 Compare August 2, 2024 02:04
@dylan-fan dylan-fan changed the base branch from dev-1.11.2 to main-1.x December 24, 2024 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant