Skip to content

Commit

Permalink
remove free_conn_timeout
Browse files Browse the repository at this point in the history
Summary: After D18638066 the `free_conn_timeout` config option is no longer needed.

Reviewed By: insomniacslk

Differential Revision: D18807575

fbshipit-source-id: b5c3d586269423c486d8c0dc415d5b4758d91795
  • Loading branch information
Pablo Mazzini authored and facebook-github-bot committed Dec 4, 2019
1 parent da5829a commit ec92cba
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 19 deletions.
2 changes: 0 additions & 2 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"port": 67,
"packet_buf_size": 1024,
"update_server_interval": 30,
"free_conn_timeout": 30,
"algorithm": "xid",
"host_sourcer": "file:hosts-v4.txt",
"rc_ratio": 0,
Expand All @@ -19,7 +18,6 @@
"port": 547,
"packet_buf_size": 1024,
"update_server_interval": 30,
"free_conn_timeout": 30,
"algorithm": "xid",
"host_sourcer": "file:hosts-v6.txt",
"rc_ratio": 0,
Expand Down
1 change: 0 additions & 1 deletion docs/extending-dhcplb.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ Create a configuration file and watch the config changes.
"port": 547,
"packet_buf_size": 1024,
"update_server_interval": 30,
"free_conn_timeout": 30,
"algorithm": "xid",
"host_sourcer": "file:hosts-v6.txt",
"rc_ratio": 0,
Expand Down
1 change: 0 additions & 1 deletion docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ Configuration is provided to the program via a JSON file
"port": 67, // port to listen on
"packet_buf_size": 1024, // size of buffer to allocate for incoming packet
"update_server_interval": 30, // how often to refresh server list (in seconds)
"free_conn_timeout": 30, // how long to wait after removal before closing a connection to a server (in seconds)
"algorithm": "xid", // balancing algorithm, supported are xid and rr (client hash and roundrobin)
"host_sourcer": "file:hosts-v4.txt", // load DHCP server list from hosts-v4.txt
"rc_ratio": 0, // what percentage of requests should go to RC servers
Expand Down
23 changes: 10 additions & 13 deletions lib/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ type Config struct {
PacketBufSize int
Handler Handler
HostSourcer DHCPServerSourcer
FreeConnTimeout time.Duration
RCRatio uint32
Overrides map[string]Override
Extras interface{}
Expand Down Expand Up @@ -198,7 +197,6 @@ type configSpec struct {
UpdateServerInterval int `json:"update_server_interval"`
PacketBufSize int `json:"packet_buf_size"`
HostSourcer string `json:"host_sourcer"`
FreeConnTimeout int `json:"free_conn_timeout"`
RCRatio uint32 `json:"rc_ratio"`
Extras json.RawMessage `json:"extras"`
CacheSize int `json:"throttle_cache_size"`
Expand Down Expand Up @@ -314,17 +312,16 @@ func newConfig(spec *configSpec, overrides map[string]Override, provider ConfigP
Algorithm: algo,
ServerUpdateInterval: time.Duration(
spec.UpdateServerInterval) * time.Second,
PacketBufSize: spec.PacketBufSize,
Handler: handler,
HostSourcer: sourcer,
FreeConnTimeout: time.Duration(spec.FreeConnTimeout) * time.Second,
RCRatio: spec.RCRatio,
Overrides: overrides,
Extras: extras,
CacheSize: spec.CacheSize,
CacheRate: spec.CacheRate,
Rate: spec.Rate,
ReplyAddr: &net.UDPAddr{IP: net.ParseIP(spec.ReplyAddr)},
PacketBufSize: spec.PacketBufSize,
Handler: handler,
HostSourcer: sourcer,
RCRatio: spec.RCRatio,
Overrides: overrides,
Extras: extras,
CacheSize: spec.CacheSize,
CacheRate: spec.CacheRate,
Rate: spec.Rate,
ReplyAddr: &net.UDPAddr{IP: net.ParseIP(spec.ReplyAddr)},
}, nil
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"port": 67,
"packet_buf_size": 1024,
"update_server_interval": 30,
"free_conn_timeout": 30,
"algorithm": "xid",
"host_sourcer": "file:/home/vagrant/dhcp-servers-v4.cfg",
"rc_ratio": 0,
Expand All @@ -19,7 +18,6 @@
"port": 547,
"packet_buf_size": 1024,
"update_server_interval": 30,
"free_conn_timeout": 30,
"algorithm": "xid",
"host_sourcer": "file:/home/vagrant/dhcp-servers-v6.cfg",
"rc_ratio": 0,
Expand Down

0 comments on commit ec92cba

Please sign in to comment.