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

IcingaDB::PrepareObject(): round Notification#times.{begin,end} not to crash Go daemon #9794

Merged

Conversation

Al2Klimov
Copy link
Member

The latter expects ints, not floats - not to mention strings. Luckily Icinga already enforces numeric strings so that we can cast it to number.

refs #9793

Test case

Standard config plus:

times = {
  	begin = "-42.5"
	#end = "-42.5"
  }

Before

-42.5

2023-06-20T10:25:23.821+0200 FATAL icingadb json: cannot unmarshal number -42.5 into Go value of type int64

"-42.5"

2023-06-20T10:26:25.967+0200 FATAL icingadb json: cannot unmarshal string into Go value of type int64

@Al2Klimov Al2Klimov added bug Something isn't working area/influxdb Metrics to InfluxDB labels Jun 20, 2023
@Al2Klimov Al2Klimov added this to the 2.14.0 milestone Jun 20, 2023
@Al2Klimov Al2Klimov requested a review from yhabteab June 20, 2023 08:56
@icinga-probot icinga-probot bot added the area/icingadb New backend label Jun 20, 2023
@cla-bot cla-bot bot added the cla/signed label Jun 20, 2023
@Al2Klimov Al2Klimov removed the area/influxdb Metrics to InfluxDB label Jun 20, 2023
yhabteab
yhabteab previously approved these changes Jun 20, 2023
Copy link
Member

@yhabteab yhabteab left a comment

Choose a reason for hiding this comment

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

Code changes looks fine but I haven't tested this.

@yhabteab
Copy link
Member

Note: Would be nice if you'd also provide an After test cases.

@Al2Klimov
Copy link
Member Author

After, i.e. with the PR, nothing special happens in contrast to before.

lib/icingadb/icingadb-objects.cpp Outdated Show resolved Hide resolved
…o crash Go daemon

The latter expects ints, not floats - not to mention strings.
Luckily Icinga already enforces numeric strings so that we can cast it to number.
….{begin,end} not to crash Go daemon

At least our PostgreSQL schema enforces positive values.
@Al2Klimov Al2Klimov force-pushed the round-notification-times-begin-end-not-to-crash-go-daemon branch from 992e412 to dccb678 Compare June 27, 2023 10:58
@julianbrost julianbrost enabled auto-merge June 27, 2023 12:38
@julianbrost julianbrost merged commit a2926b8 into master Jun 27, 2023
@icinga-probot icinga-probot bot deleted the round-notification-times-begin-end-not-to-crash-go-daemon branch June 27, 2023 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/icingadb New backend bug Something isn't working cla/signed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants