Commit Graph

12931 Commits

Author SHA1 Message Date
arberkatellari
681cd3c58a Add dryrun for CDRsV2ProcessEvent 2023-11-09 09:37:34 +01:00
arberkatellari
8781b968ac Remove unnecessary LazySanityCheck 2023-11-09 09:37:34 +01:00
arberkatellari
ec8058cd29 Adapt test to new RadiusAgent changes 2023-11-09 09:37:34 +01:00
Varun Dhand
5e513d130d fix: typo in rjreader.go 2023-11-09 09:37:34 +01:00
ionutboangiu
c282d40201 Implement reconnect logic for AMQP EventReader
Implemented functionality that handles reconnecting to the amqp server
and reinitializing the amqp channel in case of errors and timeouts. This
is handled by a goroutine created in the client constructor (it also
handles the initial connect/init).

Reconnects and reinits will use a fibonacci backoff strategy, and the
attempt amount and max waiting interval can be adjusted by the
'reconnects' and 'max_reconnect_interval' config options.

Messages that fail processing are now dropped instead of being requeued,
preventing infinite processing loops. However, this means that the
messages are lost. Handling failed messages will need to be addressed
separately.

'concurrent_requests' will now set the prefetch count. Setting the
prefetch count using the Qos function was able to replace our old
approach that was using channels. Default value is 1024 which,
according to the rabbitmq docs, 'runs into the law of diminishing
returns'. The recommended value is between 100-300. Source:
https://www.rabbitmq.com/confirms.html#channel-qos-prefetch-throughput

Fix test compilation errors and failing tests caused by these changes.

References #4160
2023-11-08 18:31:07 +01:00
ionutboangiu
f696164177 Add reconnects and max_reconnect_interval config options for ers
They are separate for each configured reader.

Additional changes:
 - rearrange config_defaults fields for ers/ees;
 - add comment for RunDelay config option inside struct definition;
 - improve comments for amqp opts in config_defaults.
2023-11-08 18:31:07 +01:00
ionutboangiu
a30e261260 Remove go type limits constants
They can be retrieved directly from the std math package.
Slightly optimize the Fib functions and improve comments.
2023-11-08 18:31:07 +01:00
ionutboangiu
9771377b51 Implement additional retrieval methods for ordered map
Map() is used to return a shallow copy of the underlying map.
GetByIndex() is used to return the key-value pair at the specified index.
2023-11-08 18:31:07 +01:00
ionutboangiu
5a832df0ae Update dependencies 2023-11-08 17:11:40 +01:00
ionutboangiu
9b18816b51 Make sure required analyzers db file exists in test 2023-11-08 17:11:40 +01:00
ionutboangiu
29f58debc9 Clone header before creating exporter HTTP request
Behind http.Header is just a map and it's not safe for concurrent use.
Before this change, a panic might have occurred when doing asynchronous
HTTP exports (applies to both *http_post and *http_json_map exporters).
Cloning the header before adding it to the HTTP request has fixed this
issue.

Slightly improved the test that found this data race.
2023-11-08 17:11:40 +01:00
gezimbll
c7e1f8f036 Remove staticchecks warnings for migrator 2023-11-08 17:10:13 +01:00
gezimbll
09e5088262 Removed warnings from go staticcheck 2023-11-08 17:10:13 +01:00
gezimbll
c2dacc42c1 Removed warnings from go staticcheck 2023-11-08 17:10:13 +01:00
gezimbll
529430bd4d added tests for debiting data units without ratingsubject 2023-11-08 17:04:41 +01:00
gezimbll
9e2a629b82 Add *log flag for logging ees events 2023-11-08 16:52:38 +01:00
Varun Dhand
c4fefedefa fix: typo in rjreader.go 2023-11-02 19:40:53 +01:00
Varun Dhand
0997d308ee Update CONTRIBUTORS.md 2023-11-02 19:40:53 +01:00
Varun Dhand
6baffaa67c fix: typo in rjreader.go 2023-11-02 19:40:53 +01:00
gezimbll
2d137915c1 Avoid potential deadlock in session test 2023-11-02 19:40:03 +01:00
ionutboangiu
d241f5deee Add test for balance blocker functionality
References issue #4163 and PR #4178.
2023-11-02 19:38:24 +01:00
ionutboangiu
3e852be287 Update it test to set up environment using setupTest()
This has been done in order to check the newly implemented helpers'
functionality.
2023-11-02 19:38:24 +01:00
ionutboangiu
ada0d948b6 Implement helper functions for setting up test environment 2023-11-02 19:38:24 +01:00
gezimbll
5a85c119c8 Replacing IsSliceMember ,CloneStringSlice and SliceStringEqual with slices package equivalent functions 2023-11-01 21:52:50 +01:00
ionutboangiu
6722d6b6a4 Remove unused DryRun field from CallDescriptor
dryRun vars will also not be considered anymore in the balance
blocker condition.

Fixes #4163
2023-11-01 21:37:32 +01:00
ionutboangiu
1a19fddda1 Update failing integration tests due to changes
libengine_it_test.go:
 - handle postgres dbtype as well
 - after rpcclient update, we receive context deadline exceeded
 instead of REPLY_TIMEOUT, so the expected value had to be
 updated.

tut_smgeneric_it_test.go
 - an additional attribute profile has been added to oldtutorial
 tariffplans, which changed the amount of profiles and indexes
 existing in the storage when testing. Expected values have been
 updated.
2023-10-27 18:51:01 +02:00
ionutboangiu
88f31c189d Optimize CDRs unit test (12s->1s) 2023-10-27 18:51:01 +02:00
ionutboangiu
a9828b5d03 Revise integration_test.sh script 2023-10-27 18:51:01 +02:00
ionutboangiu
4ca66ed6c4 Update *ec template values in test ee configuration
*ec.CostDetails.EventCostField -> *ec.EventCostField
2023-10-27 18:51:01 +02:00
ionutboangiu
38578524da Upgrade MongoDB driver to v1.12
- Set (but comment) serverAPI options (currently distinct api and
create.size BSON field are deprecated + possible others that are untested)
- Remove the custom time decoder used for mongo BSON
datetime values. The custom decoder was only converting these values
into UTC and was not any different from the default time.Time
decoder in the MongoDB driver, which also handles BSON string, int64,
and document values.
- Implement 'buildURL' function to connect to mongo (can also be
used for mysql and postgres)
- Update function names, variable names, and comments for clarity
- Replace 'bsonx.Regex' with the Regex primitive for v1.12 compatibility
- Use simple concatenation instead of Sprintf
- Declare 'decimalType' locally, replace global 'decimalType'
- Simplify several functions without altering functionality
- Converting directly from a D to an M is deprecated. We are now decoding
  directly in a M.
- Used errors.As and errors.Is for proper error comparison and assertion
- Revised sloppy reassignments and added missing error checks
2023-10-27 18:51:01 +02:00
ionutboangiu
d1d43913c8 Replace deprecated Publish method with PublishWithContext 2023-10-27 18:51:01 +02:00
arberkatellari
c4e0d92a2a Make DNS TLS error log more suggestive 2023-10-26 18:02:14 +02:00
ionutboangiu
b270112425 Update README links to docs 2023-10-26 15:55:54 +02:00
ionutboangiu
ec799dd1e9 Update expected value in kafka it test 2023-10-26 15:55:54 +02:00
ionutboangiu
9f3f4058b2 Bump mongodb version in ansible role 2023-10-26 15:55:54 +02:00
ionutboangiu
62b27b569f Make EventCost type vars satisfy the DataStorage interface 2023-10-26 15:55:54 +02:00
gezimbll
969ef4b754 Make go vet pass 2023-10-26 15:52:06 +02:00
gezimbll
16a9c7033f Remove unreachable err cases from HandleJSONErr
json.UnmarshalError happens only when we pass a non-nil pointer, which
is not the case for us. Usage of go vet helps us make sure it also
won't be happening in the future.
2023-10-26 15:52:06 +02:00
gezimbll
9df5f2e02e Added EventCost FieldAsString tests 2023-10-26 15:52:06 +02:00
arberkatellari
5872b810ec Change default storedb password 2023-10-25 10:16:07 +02:00
ionutboangiu
c4664c69c4 Replace nightly with master for deb install 2023-10-19 17:20:00 +02:00
ionutboangiu
6e182f64c1 Update kafka handler to run with sudo 2023-10-19 17:20:00 +02:00
ionutboangiu
1c0ca857ee Update libraries and fix compilation errors 2023-10-17 17:40:43 +02:00
ionutboangiu
7cc5dfb26d Update test for XmlProvider String() func 2023-10-17 17:40:43 +02:00
ionutboangiu
37ac937f97 Handle kafka topic creation/deletion within test 2023-10-17 17:40:43 +02:00
ionutboangiu
5ce0e8dfa5 Update kafka ansible role
- use kraft instead of zookeeper
- add handlers in case of cfg changes
- create a separate user for the kafka service
- bump kafka version
- make the role more configurable
2023-10-17 17:40:43 +02:00
ionutboangiu
1d8d9823fe Delete irrelevant test after xml update 2023-10-17 17:40:43 +02:00
ionutboangiu
63e06dd86a Update XmlProvider String() func
The comment specifies that it should display the already parsed values
out of cache.
2023-10-17 17:40:43 +02:00
ionutboangiu
889ec93288 Rename prefix to isAbsolute inside HP.AsString() 2023-10-17 17:40:43 +02:00
ionutboangiu
12779560ca Handle empty relative path case in HP.AsString()
Return '.' when HierarchyPath is empty and prefix is false.
2023-10-17 17:40:43 +02:00