Commit graph

1972 commits

Author SHA1 Message Date
Eric Lippmann
7eb55ae81b Support DriverContext
Our driver now supports DriverContext and uses contexts.
This basically supports that the connect function returns
immediately when a context is cancelled.
2021-06-22 14:54:33 +02:00
Eric Lippmann
40bbe3117f
Merge pull request #289 from Icinga/error-handling
Error handling
2021-06-21 17:58:45 +02:00
Eric Lippmann
40095ad0db Call errors.Wrap*() unconditionally where appropriate 2021-06-21 13:20:44 +02:00
Eric Lippmann
dac942a9a8 Use errors.As() and Is() in favor of Unwrap() 2021-06-21 13:20:44 +02:00
Eric Lippmann
752db18a91 Print stack traces 2021-06-21 13:20:44 +02:00
Eric Lippmann
dac7cceff7 Use Info() instead of Infof() if no format string 2021-06-21 12:13:24 +02:00
Eric Lippmann
e12425d8dc Wrap errors 2021-06-21 12:13:24 +02:00
Eric Lippmann
6b2ecec65b Replace custom err w/ func returing a wrapped err
This ensures that there's also a stack trace associated with the error.
2021-06-21 12:13:24 +02:00
Eric Lippmann
8e216d2f83 Fix imports 2021-06-21 12:13:24 +02:00
Eric Lippmann
d33b9488dd Add utils for wrapping errors 2021-06-21 12:13:23 +02:00
Eric Lippmann
bd577e583b
Merge pull request #269 from Icinga/bugfix/mysql-schema-bool-enums
MySQL schema: reverse order of entries in enums for boolean to fix sort order
2021-06-17 12:03:14 +02:00
Eric Lippmann
41fbd7f0cf
Merge pull request #294 from Icinga/re-add-state-indices
schema: Re-add indices for `host_id` and `service_id` in state tables
2021-06-14 12:45:07 +02:00
Eric Lippmann
7bedcc2fb4
Merge pull request #293 from Icinga/bugfix/service-file-change-to-config-file
Service File: Change config file in exec command to new YAML file
2021-06-14 12:11:54 +02:00
Eric Lippmann
7496927114
Merge pull request #296 from Icinga/dependabot/go_modules/github.com/go-redis/redis/v8-8.10.0
Bump github.com/go-redis/redis/v8 from 8.7.1 to 8.10.0
2021-06-10 22:31:11 +02:00
dependabot[bot]
e18601fa5c
Bump github.com/go-redis/redis/v8 from 8.7.1 to 8.10.0
Bumps [github.com/go-redis/redis/v8](https://github.com/go-redis/redis) from 8.7.1 to 8.10.0.
- [Release notes](https://github.com/go-redis/redis/releases)
- [Changelog](https://github.com/go-redis/redis/blob/master/CHANGELOG.md)
- [Commits](https://github.com/go-redis/redis/compare/v8.7.1...v8.10.0)

---
updated-dependencies:
- dependency-name: github.com/go-redis/redis/v8
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-10 20:02:34 +00:00
Eric Lippmann
cc956af355
Merge pull request #287 from Icinga/dependabot/go_modules/github.com/jessevdk/go-flags-1.5.0
Bump github.com/jessevdk/go-flags from 1.4.0 to 1.5.0
2021-06-10 21:59:50 +02:00
dependabot[bot]
6082108107
Bump github.com/jessevdk/go-flags from 1.4.0 to 1.5.0
Bumps [github.com/jessevdk/go-flags](https://github.com/jessevdk/go-flags) from 1.4.0 to 1.5.0.
- [Release notes](https://github.com/jessevdk/go-flags/releases)
- [Commits](https://github.com/jessevdk/go-flags/compare/v1.4.0...v1.5.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-10 19:45:27 +00:00
Eric Lippmann
5c713ff053
Merge pull request #286 from Icinga/dependabot/go_modules/go.uber.org/zap-1.17.0
Bump go.uber.org/zap from 1.16.0 to 1.17.0
2021-06-10 21:43:55 +02:00
dependabot[bot]
047debad83
Bump go.uber.org/zap from 1.16.0 to 1.17.0
Bumps [go.uber.org/zap](https://github.com/uber-go/zap) from 1.16.0 to 1.17.0.
- [Release notes](https://github.com/uber-go/zap/releases)
- [Changelog](https://github.com/uber-go/zap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/uber-go/zap/compare/v1.16.0...v1.17.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-10 12:38:03 +00:00
Eric Lippmann
8aff316363
Merge pull request #285 from Icinga/dependabot/go_modules/github.com/jmoiron/sqlx-1.3.4
Bump github.com/jmoiron/sqlx from 1.3.1 to 1.3.4
2021-06-10 14:36:35 +02:00
dependabot[bot]
954812dfbc
Bump github.com/jmoiron/sqlx from 1.3.1 to 1.3.4
Bumps [github.com/jmoiron/sqlx](https://github.com/jmoiron/sqlx) from 1.3.1 to 1.3.4.
- [Release notes](https://github.com/jmoiron/sqlx/releases)
- [Commits](https://github.com/jmoiron/sqlx/compare/v1.3.1...v1.3.4)

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-10 12:33:33 +00:00
Eric Lippmann
25d365b17e
Merge pull request #270 from Icinga/dependabot/go_modules/github.com/go-sql-driver/mysql-1.6.0
Bump github.com/go-sql-driver/mysql from 1.5.0 to 1.6.0
2021-06-10 14:32:06 +02:00
Julian Brost
c1af851038
Merge pull request #282 from Icinga/feature/issue-templates
Add issue template for bug reports
2021-06-02 09:39:47 +02:00
Johannes Meyer
df4112d88a schema: Re-add indices for host_id and service_id in state tables 2021-06-01 15:28:06 +02:00
Noah Hilverling
37c77644f8
Service File: Change config file in exec command to new YAML file 2021-06-01 12:50:57 +02:00
Julian Brost
2291081083
Merge pull request #291 from Icinga/ha-deadlock
HA: Respect context when operating channels
2021-05-31 17:05:49 +02:00
Alexander A. Klimov
8cbf24932e Add stack of current goroutine to errors 2021-05-31 16:53:57 +02:00
Alexander A. Klimov
c25c47ad72 Compare errors smartly, i.e. unwrap them first 2021-05-31 16:52:47 +02:00
Eric Lippmann
a693b52118 HA: Respect context when operating channels
The transmission processes of the handover and takeover channel can
block because in the event of a context cancellation, nobody reads
it anymore.
2021-05-31 15:31:55 +02:00
Eric Lippmann
3dcca21135
Merge pull request #288 from Icinga/customvar-runtime-updates
Add custom vars to the runtime update sync
2021-05-31 15:31:04 +02:00
Eric Lippmann
14841371f2
Merge pull request #290 from Icinga/bugfix/ha-context-cancelled-too-early
HA: context used to start transaction must not be canceled before the transaction is committed
2021-05-31 14:56:06 +02:00
Julian Brost
31aed435cc HA: context used to start transaction must not be canceled before the transaction is committed
This was introduced by 621c1b9537 and leads to
tx.Commit() always returning an "context canceled" error.
2021-05-31 14:48:15 +02:00
Eric Lippmann
8ae9c7b461 Schema: Reverse order of entries in enums for boolean
This takes into account the changes made with f7cbc22.
2021-05-31 14:42:49 +02:00
Julian Brost
f7cbc22299 MySQL schema: reverse order of entries in enums for boolean to fix sort order
This ensures that 'n' < 'y' when sorting, as you'd expect when either comparing
the alphabetical order of both values or the corresponding 0/1 values for a
boolean.
2021-05-31 14:35:30 +02:00
Eric Lippmann
2a8fc05ddb
Merge pull request #283 from Icinga/move-schema-upgrade-file-to-dedicated-directory
Move MySQL schema files to dedicated directory
2021-05-31 14:07:20 +02:00
Johannes Meyer
62582d58ac Move schema/1.0.0-rc2.sql to schema/mysql/upgrades/1.0.0-rc2.sql 2021-05-31 14:05:15 +02:00
Johannes Meyer
53f6839ee2 Move schema/mysql.schema.sql to schema/mysql/schema.sql 2021-05-31 14:05:15 +02:00
Eric Lippmann
03e899701e Add custom vars to the runtime update sync
The customvar runtime update sync may change because the customvar
flat runtime update sync is not yet implemented.
2021-05-31 13:59:13 +02:00
Eric Lippmann
0b9dd32173
Merge pull request #278 from Icinga/bugfix/lint-code
Make code quality comply to CI requirements
2021-05-31 13:52:29 +02:00
Julian Brost
c80cf4e5a2 Add issue template for bug reports 2021-05-28 18:01:35 +02:00
Eric Lippmann
b43bb02bfc
Merge pull request #281 from Icinga/feature/integrate-1.0.0-rc2-schema
Integrate 1.0.0-rc2 schema
2021-05-28 17:42:05 +02:00
Julian Brost
6cc2cd01b2 Increment icingadb_schema version 2021-05-28 17:11:54 +02:00
Julian Brost
228b149293 1.0.0-rc2.sql: add all changes since v1.0.0-rc1 git tag 2021-05-28 17:11:03 +02:00
Julian Brost
445ce238f9 mysql.schema.sql: integrate changes from 1.0.0-rc2.sql 2021-05-28 16:20:37 +02:00
Eric Lippmann
9fdcc83979
Merge pull request #279 from Icinga/N-o-X-patch-1
README.md: Fix new config setup step
2021-05-28 14:27:10 +02:00
Alexander A. Klimov
b0354e3503 Don't misuse loop as if 2021-05-28 14:24:36 +02:00
Alexander A. Klimov
afe0a90487 s/CondClosed/ErrCondClosed/ 2021-05-28 14:24:36 +02:00
Alexander A. Klimov
64433ec674 Make channel for signal.Notify() buffered 2021-05-28 14:24:36 +02:00
Alexander A. Klimov
1329c68cf3 Use !bytes.Equal(x,y), not bytes.Compare(x,y)!=0 2021-05-28 14:24:36 +02:00
Alexander A. Klimov
a4abdce1f0 Use time.Since(x), not time.Now().Sub(x) 2021-05-28 14:24:36 +02:00