File tree Expand file tree Collapse file tree 4 files changed +12
-7
lines changed Expand file tree Collapse file tree 4 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -7,10 +7,10 @@ controller_name: apisix.apache.org/api7-ingress-controller # The controller nam
77leader_election_id : " api7-ingress-controller-leader" # The leader election ID for the API7 Ingress Controller.
88 # The default value is "api7-ingress-controller-leader".
99leader_election :
10- lease_duration : 15s # lease_duration is the duration that non-leader candidates will wait
10+ lease_duration : 30s # lease_duration is the duration that non-leader candidates will wait
1111 # after observing a leadership renewal until attempting to acquire leadership of a
1212 # leader election.
13- renew_deadline : 10s # renew_deadline is the time in seconds that the acting controller
13+ renew_deadline : 20s # renew_deadline is the time in seconds that the acting controller
1414 # will retry refreshing leadership before giving up.
1515 retry_period : 2s # retry_period is the time in seconds that the acting controller
1616 # will wait between tries of actions with the controller.
Original file line number Diff line number Diff line change @@ -37,8 +37,8 @@ func NewDefaultConfig() *Config {
3737
3838func NewLeaderElection () * LeaderElection {
3939 return & LeaderElection {
40- LeaseDuration : types.TimeDuration {Duration : 15 * time .Second },
41- RenewDeadline : types.TimeDuration {Duration : 10 * time .Second },
40+ LeaseDuration : types.TimeDuration {Duration : 30 * time .Second },
41+ RenewDeadline : types.TimeDuration {Duration : 20 * time .Second },
4242 RetryPeriod : types.TimeDuration {Duration : 2 * time .Second },
4343 Disable : false ,
4444 }
Original file line number Diff line number Diff line change @@ -50,8 +50,8 @@ type ControlPlaneConfig struct {
5050}
5151
5252type LeaderElection struct {
53- LeaseDuration types.TimeDuration `json:"leaseDuration ,omitempty" yaml:"leaseDuration ,omitempty"`
54- RenewDeadline types.TimeDuration `json:"renewDeadline ,omitempty" yaml:"renewDeadline ,omitempty"`
55- RetryPeriod types.TimeDuration `json:"retryPeriod ,omitempty" yaml:"retryPeriod ,omitempty"`
53+ LeaseDuration types.TimeDuration `json:"lease_duration ,omitempty" yaml:"lease_duration ,omitempty"`
54+ RenewDeadline types.TimeDuration `json:"renew_deadline ,omitempty" yaml:"renew_deadline ,omitempty"`
55+ RetryPeriod types.TimeDuration `json:"retry_period ,omitempty" yaml:"retry_period ,omitempty"`
5656 Disable bool `json:"disable,omitempty" yaml:"disable,omitempty"`
5757}
Original file line number Diff line number Diff line change @@ -32,6 +32,8 @@ type adcConfig struct {
3232type adcClient struct {
3333 sync.Mutex
3434
35+ execLock sync.Mutex
36+
3537 translator * translator.Translator
3638 // gateway/ingressclass -> adcConfig
3739 configs map [provider.ResourceKind ]adcConfig
@@ -227,6 +229,9 @@ func (d *adcClient) sync(ctx context.Context, task Task) error {
227229}
228230
229231func (d * adcClient ) execADC (ctx context.Context , config adcConfig , args []string ) error {
232+ d .execLock .Lock ()
233+ defer d .execLock .Unlock ()
234+
230235 ctxWithTimeout , cancel := context .WithTimeout (ctx , d .syncTimeout )
231236 defer cancel ()
232237 // todo: use adc config
You can’t perform that action at this time.
0 commit comments