Is there a way to pass some information to the server so that the server can reject the client within the SimpleClientManager.register
method?
When I try this example with flower 1.12.0, the client.get_properties(...)
call hangs indefinitely:
# client
import flwr as fl
class FlowerClient(fl.client.NumPyClient):
def get_properties(
self, config: dict[str, bool | bytes | float | int | str]
) -> dict[str, bool | bytes | float | int | str]:
res = {
"msg": "hello",
}
return res
fl.client.start_client(
server_address="localhost:8080",
client=FlowerClient().to_client(),
)
# server
import flwr as fl
from flwr.server.client_proxy import ClientProxy
from flwr.common import GetPropertiesIns
from flwr.server.client_manager import SimpleClientManager
class ClientManager(SimpleClientManager):
def register(self, client: ClientProxy) -> bool:
# Here, the properties are not populated (which would already solve the problem)
print("Registering client", client, client.properties)
# Calling get_properties hangs
print(client.get_properties(GetPropertiesIns({}), None, None))
return super().register(client)
fl.server.start_server(
server_address="0.0.0.0:8080",
config=fl.server.ServerConfig(num_rounds=1),
client_manager=ClientManager(),
)