Module: kamailio
Branch: 5.3
Commit: f35c7fe0016fea44bbfa4d686f985cf5db4a3372
URL: https://github.com/kamailio/kamailio/commit/f35c7fe0016fea44bbfa4d686f985cf…
Author: Victor Seva <vseva(a)sipwise.com>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2022-03-15T08:50:54+01:00
db_redis: clean previous connection before trying to reconnect
(cherry picked from commit 78c8d084e30373aacc456fd41062b68e6e82ea6f)
(cherry picked from commit 2e0537ba306219df0ce71605848e811027c69a57)
(cherry picked from commit 78506f7f2dfcdbf2bc9e21168929437516a368bd)
---
Modified: src/modules/db_redis/redis_connection.c
---
Diff: https://github.com/kamailio/kamailio/commit/f35c7fe0016fea44bbfa4d686f985cf…
Patch: https://github.com/kamailio/kamailio/commit/f35c7fe0016fea44bbfa4d686f985cf…
---
diff --git a/src/modules/db_redis/redis_connection.c b/src/modules/db_redis/redis_connection.c
index 5a5887d658..bb7423fcbd 100644
--- a/src/modules/db_redis/redis_connection.c
+++ b/src/modules/db_redis/redis_connection.c
@@ -111,6 +111,11 @@ int db_redis_connect(km_redis_con_t *con) {
db = atoi(con->id->database);
reply = NULL;
+ if(con->con) {
+ LM_DBG("free old connection first\n");
+ redisFree(con->con);
+ }
+
// TODO: introduce require_master mod-param and check if we're indeed master
// TODO: on carrier, if we have db fail-over, the currently connected
// redis server will become slave without dropping connections?
Module: kamailio
Branch: 5.4
Commit: 78506f7f2dfcdbf2bc9e21168929437516a368bd
URL: https://github.com/kamailio/kamailio/commit/78506f7f2dfcdbf2bc9e21168929437…
Author: Victor Seva <vseva(a)sipwise.com>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2022-03-15T08:50:01+01:00
db_redis: clean previous connection before trying to reconnect
(cherry picked from commit 78c8d084e30373aacc456fd41062b68e6e82ea6f)
(cherry picked from commit 2e0537ba306219df0ce71605848e811027c69a57)
---
Modified: src/modules/db_redis/redis_connection.c
---
Diff: https://github.com/kamailio/kamailio/commit/78506f7f2dfcdbf2bc9e21168929437…
Patch: https://github.com/kamailio/kamailio/commit/78506f7f2dfcdbf2bc9e21168929437…
---
diff --git a/src/modules/db_redis/redis_connection.c b/src/modules/db_redis/redis_connection.c
index dd421a7844..d6c24163b1 100644
--- a/src/modules/db_redis/redis_connection.c
+++ b/src/modules/db_redis/redis_connection.c
@@ -112,6 +112,11 @@ int db_redis_connect(km_redis_con_t *con) {
db = atoi(con->id->database);
reply = NULL;
+ if(con->con) {
+ LM_DBG("free old connection first\n");
+ redisFree(con->con);
+ }
+
// TODO: introduce require_master mod-param and check if we're indeed master
// TODO: on carrier, if we have db fail-over, the currently connected
// redis server will become slave without dropping connections?
Module: kamailio
Branch: 5.5
Commit: 2e0537ba306219df0ce71605848e811027c69a57
URL: https://github.com/kamailio/kamailio/commit/2e0537ba306219df0ce71605848e811…
Author: Victor Seva <vseva(a)sipwise.com>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2022-03-15T08:49:14+01:00
db_redis: clean previous connection before trying to reconnect
(cherry picked from commit 78c8d084e30373aacc456fd41062b68e6e82ea6f)
---
Modified: src/modules/db_redis/redis_connection.c
---
Diff: https://github.com/kamailio/kamailio/commit/2e0537ba306219df0ce71605848e811…
Patch: https://github.com/kamailio/kamailio/commit/2e0537ba306219df0ce71605848e811…
---
diff --git a/src/modules/db_redis/redis_connection.c b/src/modules/db_redis/redis_connection.c
index dd421a7844..d6c24163b1 100644
--- a/src/modules/db_redis/redis_connection.c
+++ b/src/modules/db_redis/redis_connection.c
@@ -112,6 +112,11 @@ int db_redis_connect(km_redis_con_t *con) {
db = atoi(con->id->database);
reply = NULL;
+ if(con->con) {
+ LM_DBG("free old connection first\n");
+ redisFree(con->con);
+ }
+
// TODO: introduce require_master mod-param and check if we're indeed master
// TODO: on carrier, if we have db fail-over, the currently connected
// redis server will become slave without dropping connections?
When running kamdbctl create, it fails. The error is as show below. Can someone with knowledge please help me solve this.
/usr/share/kamailio/mysql$ kamdbctl create
MySQL password for root:
-e database engine 'mysql' loaded
-e \E[37;33mINFO: test server charset
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1682 (HY000) at line 1: Native table 'performance_schema'.'session_variables' has the wrong structure
mysql: [Warning] Using a password on the command line interface can be insecure.
Usage: grep [OPTION]... PATTERN [FILE]...
Try 'grep --help' for more information.
/usr/sbin/kamdbctl: 117: [: =: unexpected operator
-e \E[37;33mINFO: creating database kamailio ...
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
-e \E[37;31mERROR: Creatin
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3055
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3055(a)github.com>
### Description
The ds_reload() function in dispatcher.c always returns -1, even when successful.
### Possible Solutions
I think a patch like the following would resolve the issue.
```
diff --git a/src/modules/dispatcher/dispatcher.c b/src/modules/dispatcher/dispatcher.c
index 059df89123..83d6b45ee9 100644
--- a/src/modules/dispatcher/dispatcher.c
+++ b/src/modules/dispatcher/dispatcher.c
@@ -963,13 +963,15 @@ static int ds_reload(sip_msg_t *msg)
*ds_rpc_reload_time = time(NULL);
if(!ds_db_url.s) {
- if(ds_load_list(dslistfile) != 0)
+ if(ds_load_list(dslistfile) != 0) {
LM_ERR("Error reloading from list\n");
- return -1;
+ return -1;
+ }
} else {
- if(ds_reload_db() < 0)
+ if(ds_reload_db() < 0) {
LM_ERR("Error reloading from db\n");
- return -1;
+ return -1;
+ }
}
LM_DBG("reloaded dispatcher\n");
return 1;
```
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
5.5.3
```
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3054
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3054(a)github.com>