[ 
https://issues.apache.org/jira/browse/FLINK-31837?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Matthias Pohl updated FLINK-31837:
----------------------------------
    Description: The {{LeaderElectionDriver}} should only be instantiated if 
there is a contender which wants to participate in the leader election. 
Therefore, we should call {{LeaderElectionDriver}} instantiation lazily in 
{{DefaultLeaderElectionService#register}}.  (was: With the 
{{MultipleComponentLeaderElection*}} classes we added a circular dependency 
between the {{DefaultLeaderElectionService}} and the 
{{DefaultMultipleComponentLeaderElectionService}} which calls the 
{{DefaultLeaderElectionService.onGrantLeadership}} while registering the 
service in 
[DefaultMultipleComponentLeaederElectionService:152|https://github.com/apache/flink/blob/master/flink-runtime/src/main/java/org/apache/flink/runtime/leaderelection/DefaultMultipleComponentLeaderElectionService.java#L152].
 This call will result in accessing the {{DefaultLeaderElectionService}} 
instance which is still in instantiation phase.

We're losing the circular dependency with the 
{{MultipleComponentsLeaderElectionDriverAdapter}} class going away. Hence, we 
can go ahead and move the driver instantiation into the constructor.)

> Move LeaderElectionDriver instantiated into 
> DefaultLeaderElectionService.register to instantiate the driver lazily
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: FLINK-31837
>                 URL: https://issues.apache.org/jira/browse/FLINK-31837
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Runtime / Coordination
>            Reporter: Matthias Pohl
>            Priority: Major
>
> The {{LeaderElectionDriver}} should only be instantiated if there is a 
> contender which wants to participate in the leader election. Therefore, we 
> should call {{LeaderElectionDriver}} instantiation lazily in 
> {{DefaultLeaderElectionService#register}}.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to