Skip to content
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

Cfg: can't address implicit default group in sched_http_rules #748

Closed
vankoven opened this issue Jun 9, 2017 · 2 comments
Closed

Cfg: can't address implicit default group in sched_http_rules #748

vankoven opened this issue Jun 9, 2017 · 2 comments
Assignees
Milestone

Comments

@vankoven
Copy link
Contributor

vankoven commented Jun 9, 2017

It is impossible to use default server group in sched_http_rules if it is not explicitly defined in config file.

E.g. the next config cannot be parsed correctly:

sched hash;
server 192.168.122.1:8000 conns_n=1;

srv_group backup {
sched hash;
server 192.168.122.1:8001 conns_n=1;

}
cache 0;

sched_http_rules {
  match default * * * backup=backup;
}

Tempesta log:

[  124.516470] [tempesta] ERROR: sched_http: srv_group is not found: 'default'
[  124.517535] [tempesta] ERROR: configuration parsing error
[  124.518707] [tempesta] ERROR: failed to start modules

Parsing of sched_http_rules section requires defining server groups before using them. But implicit default group will be created only when configuration file will be fully parsed (see tfw_sock_srv_start() function). This breaks user experience, especially if user writes full configuration of implicit default group before sched_http_rules section.

Posiible solution: create implicit default server group when the first server of that group was encountered.

@vankoven vankoven self-assigned this Jun 9, 2017
@krizhanovsky
Copy link
Contributor

The proposal should work. It'd be expected if we require C-behavior: define something before using it. So if a user uses default group in sched_http_rules and next defines the default group, then we should fail to error because we already created the goup when faced it in the scheduler sched_http_rules section.

@krizhanovsky krizhanovsky added this to the 1.0 WebOS milestone Jun 9, 2017
@krizhanovsky
Copy link
Contributor

Relates #51 and should be fixed in the same PR.

@krizhanovsky krizhanovsky modified the milestones: 0.5.0 Web Server, 1.0 WebOS Jun 10, 2017
@krizhanovsky krizhanovsky assigned keshonok and unassigned vankoven Jun 10, 2017
vankoven added a commit that referenced this issue Jun 14, 2017
as described in #748, implicit "default" group is currently not
available to be used in "sched_http_rules"
@krizhanovsky krizhanovsky assigned vankoven and unassigned keshonok Aug 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants