-
Notifications
You must be signed in to change notification settings - Fork 105
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: wrong position is printed in log messages in case of parser error #65
Comments
Tryed now. Inserted random string in the middle config file, then started tempesta, in log was text: |
It appears that #65 isn't fixed at all. A sample configuration file from #418
Produces wrong output (note that the actual error is at 4th line):
Firstly, the line is wrong. Secondly, The lines number is quite important because we use rate limited printing, so a user can not see the errors at all in case of several restarts. (Actually I faced the case during my tests). A possible solution could be introducing special TFW_{ERR,WARN,etc} macro w/o rate limiting. The macros should be used at startup and shutdown cases only, when we know exactly that there won't be a lot of messages and they're crucial for a user. In general configuration error must be shown in user friendly manner. So that it's easy for a user to understand what they did wrong. Please also address code dirtiness in ed366efa , e.g. ed366efa#diff-5b6567e29085fde4971054cd52df15a5R393 Crucial since directly affects user experience. |
Scenario:
sdafasdg
) in the middle of the file.Something like this appears in the log:
It shows the wrong position in the configuration file.
That happens because the parser tries to read more tokens and eventually reaches EOF without meeting a
;
character which is a syntax error.The position where the parser stops is the end of the buffer, so it shows some contents around this position which is not what you expect to see.
Generally this is not about EOF, the tokenizer always eats comments implicitly, so you always see a wrong position in the log message if there are comments after it.
The default configuration file contains a lot of comments, so this is an issue.
TODO:
The text was updated successfully, but these errors were encountered: