Attention is currently required from: keith, pespin.
fixeria has posted comments on this change by keith. ( https://gerrit.osmocom.org/c/osmo-msc/+/28340?usp=email )
Change subject: sqlite optimisation: Avoid unneeded database operation
......................................................................
Patch Set 7: Code-Review+1
(1 comment)
File src/libmsc/db.c:
https://gerrit.osmocom.org/c/osmo-msc/+/28340/comment/3398893b_f0566a9e?usp… :
PS4, Line 303: DB_STMT_SMS_DEL_EXPIRED
> I'd prefer to keep you happy in this patch. I can remove the LIMIT clause.
Thanks.
> I'd propose to get rid of this one (EXPIRED) an replace its use in the code with the other one, just plain old: DB_STMT_SMS_DEL_BY_ID
Ack, this is exactly what I had in mind.
--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/28340?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I777155c0f818b979c636bb59953719e472771603
Gerrit-Change-Number: 28340
Gerrit-PatchSet: 7
Gerrit-Owner: keith <keith(a)rhizomatica.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: keith <keith(a)rhizomatica.org>
Gerrit-Comment-Date: Tue, 14 Oct 2025 08:34:50 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
Comment-In-Reply-To: keith <keith(a)rhizomatica.org>
Attention is currently required from: fixeria, pespin.
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-msc/+/28340?usp=email
to look at the new patch set (#7).
Change subject: sqlite optimisation: Avoid unneeded database operation
......................................................................
sqlite optimisation: Avoid unneeded database operation
It is pointless to mark an SMS as sent immediatly
before deleting it. Let's avoid the extra database
overhead involved in doing this operation.
We change the db function which is used to delete
SMS, changing the where clause, so let's also
remove the word "sent" in the function name,
now: db_sms_delete_message_by_id()
This function is only called from one place; when
deleting sent messages, but better the name
reflects what it actually does. By the same logic,
the database statement is now called "DEL_BY_ID" and
ends up being a duplicate of what was denoted as
DEL_EXPIRED, so remove this later, which in itself has
nothing to do with the validity or expiration, but was
called from delete_expired_sms(). Call the DEL_BY_ID
statement there instead, which is a more accurate descrption
of the actual statement being run.
The unit test is changed now that we cannot
delete based on sent status anymore.
Change-Id: I777155c0f818b979c636bb59953719e472771603
---
M include/osmocom/msc/db.h
M src/libmsc/db.c
M src/libmsc/gsm_04_11.c
M src/libmsc/sms_queue.c
M tests/db_sms/db_sms_test.c
M tests/db_sms/db_sms_test.ok
6 files changed, 12 insertions(+), 24 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/40/28340/7
--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/28340?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I777155c0f818b979c636bb59953719e472771603
Gerrit-Change-Number: 28340
Gerrit-PatchSet: 7
Gerrit-Owner: keith <keith(a)rhizomatica.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Attention is currently required from: fixeria, pespin.
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-msc/+/28340?usp=email
to look at the new patch set (#6).
The following approvals got outdated and were removed:
Verified+1 by Jenkins Builder
Change subject: sqlite optimisation: Avoid unneeded database operation
......................................................................
sqlite optimisation: Avoid unneeded database operation
It is pointless to mark an SMS as sent immediatly
before deleting it. Let's avoid the extra database
overhead involved in doing this operation.
We change the db function which is used to delete
SMS, changing the where clause, so let's also
remove the word "sent" in the function name,
now: db_sms_delete_message_by_id()
This function is only called from one place; when
deleting sent messages, but better the name
reflects what it actually does. On the same logic,
the database statement is now called "DEL_BY_ID" and
ends up being a duplicate of what was denoted as
DEL_EXPIRED, so remove this later, which it itself has
to do with the validity or expiration, but was called
from delete_expired_sms(). Call the DEL_BY_ID statement
there instead, which is a more accurate descrption of the
actual statement being run.
The unit test is changed now that we cannot
delete based on sent status anymore.
Change-Id: I777155c0f818b979c636bb59953719e472771603
---
M include/osmocom/msc/db.h
M src/libmsc/db.c
M src/libmsc/gsm_04_11.c
M src/libmsc/sms_queue.c
M tests/db_sms/db_sms_test.c
M tests/db_sms/db_sms_test.ok
6 files changed, 12 insertions(+), 24 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/40/28340/6
--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/28340?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I777155c0f818b979c636bb59953719e472771603
Gerrit-Change-Number: 28340
Gerrit-PatchSet: 6
Gerrit-Owner: keith <keith(a)rhizomatica.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Attention is currently required from: fixeria, pespin.
keith has posted comments on this change by keith. ( https://gerrit.osmocom.org/c/osmo-msc/+/28340?usp=email )
Change subject: sqlite optimisation: Avoid unneeded database operation
......................................................................
Patch Set 5:
(1 comment)
File src/libmsc/db.c:
https://gerrit.osmocom.org/c/osmo-msc/+/28340/comment/766d0755_3d775ae1?usp… :
PS4, Line 303: DB_STMT_SMS_DEL_EXPIRED
> I believe this was already brought up here by other reviewers: we now have two identical queries in […]
It was in relation to a different "duplicate" which wasn't really a duplicate. Anyway, I didn't notice this one, and I see now. You are correct, these are two essentially the same queries.
I'd prefer to keep you happy in this patch. I can remove the LIMIT clause.
I'd also say that DB_STMT_SMS_DEL_*EXPIRED* is inaccurate, there's nothing in the query that limits it to "expired" SMS.
I'd propose to get rid of this one (EXPIRED) an replace its use in the code with the other one, just plain old: DB_STMT_SMS_DEL_BY_ID
By the way, I feel you're nitpicking a little :-) It's OK and I appreciate it, but let me just say that the state of the SMS database (and the insane beast that is the code that interacts with it) is hardly something perfect to be precious about.
It's likely nobody else has ever run this code with 10s of SMS per second going on. Believe me, I've scrutinised it. I think it was probably initially hacked quickly into nitb at a CCC event or something.
You know, like.. we define a column as TIMESTAMP and yet it is, after all, sqlite3 :-)
--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/28340?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I777155c0f818b979c636bb59953719e472771603
Gerrit-Change-Number: 28340
Gerrit-PatchSet: 5
Gerrit-Owner: keith <keith(a)rhizomatica.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 14 Oct 2025 00:37:13 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41216?usp=email )
Change subject: testenv: set PYTHONUNBUFFERED=1
......................................................................
testenv: set PYTHONUNBUFFERED=1
Prepare to run PyHSS, which needs this variable to be set or else no log
messages are printed. This problem exists with potentially all python
scripts that testenv would run, so set the env var for all commands.
Change-Id: I155f7c7bd9b985094e36fee6c6a2acfe556f580d
---
M _testenv/testenv/cmd.py
1 file changed, 1 insertion(+), 0 deletions(-)
Approvals:
laforge: Looks good to me, approved
Jenkins Builder: Verified
fixeria: Looks good to me, but someone else must approve
diff --git a/_testenv/testenv/cmd.py b/_testenv/testenv/cmd.py
index d637129..c14f694 100644
--- a/_testenv/testenv/cmd.py
+++ b/_testenv/testenv/cmd.py
@@ -106,6 +106,7 @@
ret["PATH"] = path
ret["HOME"] = os.environ.get("HOME")
+ ret["PYTHONUNBUFFERED"] = "1"
for var in env:
ret[var] = env[var]
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41216?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I155f7c7bd9b985094e36fee6c6a2acfe556f580d
Gerrit-Change-Number: 41216
Gerrit-PatchSet: 3
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>