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

CONTEXT: lazily evaluate frames to only actually assemble when needed #9557

Merged
merged 4 commits into from
Nov 30, 2022

Conversation

Al2Klimov
Copy link
Member

@Al2Klimov Al2Klimov commented Oct 28, 2022

[2022-10-28 17:38:10 +0200] information/cli: Icinga application loader (version: v2.13.0-461-g8e3a13020; debug)
[2022-10-28 17:38:10 +0200] information/cli: Loading configuration file(s).
[2022-10-28 17:38:11 +0200] information/ConfigItem: Committing config item(s).
[2022-10-28 17:38:11 +0200] critical/config: Error: Error while evaluating expression: Tried to access undefined script variable 'x'
Location: in /Users/aklimov/NET/WS/icinga2/prefix/etc/icinga2/conf.d/services.conf: 31:53-31:53
/Users/aklimov/NET/WS/icinga2/prefix/etc/icinga2/conf.d/services.conf(29):   check_command = "ping4"
/Users/aklimov/NET/WS/icinga2/prefix/etc/icinga2/conf.d/services.conf(30):
/Users/aklimov/NET/WS/icinga2/prefix/etc/icinga2/conf.d/services.conf(31):   assign where host.address && ((function() { throw x })())
                                                                                                                               ^
/Users/aklimov/NET/WS/icinga2/prefix/etc/icinga2/conf.d/services.conf(32): }
/Users/aklimov/NET/WS/icinga2/prefix/etc/icinga2/conf.d/services.conf(33):

Context:

	(0) Evaluating 'apply' rule (in /Users/aklimov/NET/WS/icinga2/prefix/etc/icinga2/conf.d/services.conf: 26:1-26:21)
	(1) Evaluating 'apply' rules for host 'alexandersmbp2.int.netways.de'
[2022-10-28 17:38:11 +0200] critical/config: 1 error
[2022-10-28 17:38:11 +0200] critical/cli: Config validation failed. Re-run with 'icinga2 daemon -C' after fixing the config.

closes #9556

@Al2Klimov Al2Klimov added area/configuration DSL, parser, compiler, error handling core/quality Improve code, libraries, algorithms, inline docs labels Oct 28, 2022
@Al2Klimov Al2Klimov self-assigned this Oct 28, 2022
@cla-bot cla-bot bot added the cla/signed label Oct 28, 2022
lib/base/context.hpp Outdated Show resolved Hide resolved
Copy link
Contributor

@julianbrost julianbrost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have already changed some callers of CONTEXT(). There are quite a few that use the + operator for building the string. It might make sense to consistently use one or the other (less from a performance point of view but more from a "this is the intended way to use this" point of view).

lib/base/context.hpp Outdated Show resolved Hide resolved
@Al2Klimov Al2Klimov force-pushed the ctx branch 2 times, most recently from f9da5be to d9f1200 Compare November 24, 2022 11:40
lib/base/context.hpp Outdated Show resolved Hide resolved
lib/base/context.cpp Show resolved Hide resolved
@julianbrost julianbrost added this to the 2.14.0 milestone Nov 30, 2022
@Al2Klimov Al2Klimov removed their assignment Nov 30, 2022
@julianbrost julianbrost merged commit adf5e6e into master Nov 30, 2022
@icinga-probot icinga-probot bot deleted the ctx branch November 30, 2022 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/configuration DSL, parser, compiler, error handling cla/signed core/quality Improve code, libraries, algorithms, inline docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants