-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
OPTIONS pings that are separated in time gradually converge #1133
Labels
bug
Something isn't working
Comments
yois615
added a commit
to yois615/freeswitch
that referenced
this issue
Oct 31, 2021
In FS-6400, the attempt was made to randomize OPTIONS packets to be sent at a random interval. The same random interval is applied to all endpoints so this doesn't work. Furthermore, rounding withing the code will ultimately make the ping times converge over time. This commmit will apply the random interval only during registration of the endpoint. All subsequent pings will be incremented with the actual value of ping-mean-interval. Fixes signalwire#1132, Fixes signalwire#1133
yois615
added a commit
to yois615/freeswitch
that referenced
this issue
Oct 31, 2021
In FS-6400, the attempt was made to randomize OPTIONS packets to be sent at a random interval. The same random interval is applied to all endpoints so this doesn't work. Furthermore, rounding withing the code will ultimately make the ping times converge over time. This commmit will apply the random interval only during registration of the endpoint. All subsequent pings will be incremented with the actual value of ping-mean-interval. Fixes signalwire#1132, Fixes signalwire#1133
yois615
added a commit
to yois615/freeswitch
that referenced
this issue
Nov 1, 2021
In randomization of numbers for ping intervals, srand was called each time the randomization function was called. This is incorrect as all the registrations were getting the same value instead of a random one. We move srand() to the beginning of the worker thread launch in order to generate random numbers correctly. Fixes signalwire#1133
yois615
added a commit
to yois615/freeswitch
that referenced
this issue
Nov 5, 2021
In FS-6400, the attempt was made to randomize OPTIONS packets to be sent at a random interval. The same random interval is applied to all endpoints so this doesn't work. Furthermore, rounding within the code, as well as reseeding with srand() on each run will ultimately make the ping times converge over time. Once the times converge, they will not separate since the reseeding will cause the same random number to apply to each registration. This commmit will apply the random interval only during initial registration and update of registration. All subsequent pings will be incremented with the actual value of ping-mean-interval. (This parameter name is no longer accurate, and would be better named ping-max-interval). srand() has been moved to the start of the worker thread, and all repeat calls have been removed, so that each call of rand(), even during the same second, generates a different random number. Fixes signalwire#1132, Fixes signalwire#1133
yois615
added a commit
to yois615/freeswitch
that referenced
this issue
Nov 23, 2021
In FS-6400, the attempt was made to randomize OPTIONS packets to be sent at a random interval. The same random interval is applied to all endpoints so this doesn't work. Furthermore, rounding within the code, as well as reseeding with srand() on each run will ultimately make the ping times converge over time. Once the times converge, they will not separate since the reseeding will cause the same random number to apply to each registration. This commmit will apply the random interval only during initial registration and update of registration. All subsequent pings will be incremented with the actual value of ping-mean-interval. (This parameter name is no longer accurate, and would be better named ping-max-interval). srand() has been moved to the start of the worker thread, and all repeat calls have been removed, so that each call of rand(), even during the same second, generates a different random number. Fixes signalwire#1132, Fixes signalwire#1133
yois615
added a commit
to yois615/freeswitch
that referenced
this issue
Jul 29, 2022
In FS-6400, the attempt was made to randomize OPTIONS packets to be sent at a random interval. The same random interval is applied to all endpoints so this doesn't work. Furthermore, rounding within the code, as well as reseeding with srand() on each run will ultimately make the ping times converge over time. Once the times converge, they will not separate since the reseeding will cause the same random number to apply to each registration. This commmit will apply the random interval only during initial registration and update of registration. All subsequent pings will be incremented with the actual value of ping-mean-interval. (This parameter name is no longer accurate, and would be better named ping-max-interval). srand() has been moved to the start of the worker thread, and all repeat calls have been removed, so that each call of rand(), even during the same second, generates a different random number. Fixes signalwire#1132, Fixes signalwire#1133
yois615
added a commit
to yois615/freeswitch
that referenced
this issue
Nov 20, 2022
In FS-6400, the attempt was made to randomize OPTIONS packets to be sent at a random interval. The same random interval is applied to all endpoints so this doesn't work. Furthermore, rounding within the code, as well as reseeding with srand() on each run will ultimately make the ping times converge over time. Once the times converge, they will not separate since the reseeding will cause the same random number to apply to each registration. This commmit will apply the random interval only during initial registration and update of registration. All subsequent pings will be incremented with the actual value of ping-mean-interval. (This parameter name is no longer accurate, and would be better named ping-max-interval). srand() has been moved to the start of the worker thread, and all repeat calls have been removed, so that each call of rand(), even during the same second, generates a different random number. Fixes signalwire#1132, Fixes signalwire#1133
yois615
added a commit
to yois615/freeswitch
that referenced
this issue
Nov 21, 2022
In FS-6400, the attempt was made to randomize OPTIONS packets to be sent at a random interval. The same random interval is applied to all endpoints so this doesn't work. Furthermore, rounding within the code, as well as reseeding with srand() on each run will ultimately make the ping times converge over time. Once the times converge, they will not separate since the reseeding will cause the same random number to apply to each registration. This commmit will apply the random interval only during initial registration and update of registration. All subsequent pings will be incremented with the actual value of ping-mean-interval. (This parameter name is no longer accurate, and would be better named ping-max-interval). srand() has been moved to the start of the worker thread, and all repeat calls have been removed, so that each call of rand(), even during the same second, generates a different random number. Fixes signalwire#1132, Fixes signalwire#1133
yois615
added a commit
to yois615/freeswitch
that referenced
this issue
Nov 21, 2022
In FS-6400, the attempt was made to randomize OPTIONS packets to be sent at a random interval. The same random interval is applied to all endpoints so this doesn't work. Furthermore, rounding within the code, as well as reseeding with srand() on each run will ultimately make the ping times converge over time. Once the times converge, they will not separate since the reseeding will cause the same random number to apply to each registration. This commmit will apply the random interval only during initial registration and update of registration. All subsequent pings will be incremented with the actual value of ping-mean-interval. (This parameter name is no longer accurate, and would be better named ping-max-interval). srand() has been moved to the start of the worker thread, and all repeat calls have been removed, so that each call of rand(), even during the same second, generates a different random number. Fixes signalwire#1132, Fixes signalwire#1133
greenbea
pushed a commit
to greenbea/freeswitch
that referenced
this issue
Mar 28, 2023
In FS-6400, the attempt was made to randomize OPTIONS packets to be sent at a random interval. The same random interval is applied to all endpoints so this doesn't work. Furthermore, rounding within the code, as well as reseeding with srand() on each run will ultimately make the ping times converge over time. Once the times converge, they will not separate since the reseeding will cause the same random number to apply to each registration. This commmit will apply the random interval only during initial registration and update of registration. All subsequent pings will be incremented with the actual value of ping-mean-interval. (This parameter name is no longer accurate, and would be better named ping-max-interval). srand() has been moved to the start of the worker thread, and all repeat calls have been removed, so that each call of rand(), even during the same second, generates a different random number. Fixes signalwire#1132, Fixes signalwire#1133
Preston-PLB
pushed a commit
to Preston-PLB/freeswitch
that referenced
this issue
Aug 14, 2023
In FS-6400, the attempt was made to randomize OPTIONS packets to be sent at a random interval. The same random interval is applied to all endpoints so this doesn't work. Furthermore, rounding within the code, as well as reseeding with srand() on each run will ultimately make the ping times converge over time. Once the times converge, they will not separate since the reseeding will cause the same random number to apply to each registration. This commmit will apply the random interval only during initial registration and update of registration. All subsequent pings will be incremented with the actual value of ping-mean-interval. (This parameter name is no longer accurate, and would be better named ping-max-interval). srand() has been moved to the start of the worker thread, and all repeat calls have been removed, so that each call of rand(), even during the same second, generates a different random number. Fixes signalwire#1132, Fixes signalwire#1133
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
When investigating #1132, I manually set the ping_expires times in the sip_registrations table to all different values. About 20 minutes later they had converged on to mainly one value.
To Reproduce
Steps to reproduce the behaviour:
<param name="all-reg-options-ping" value="true"/>
update sip_registrations set ping_expires=ping_expires+round(random()*60);
Expected behaviour
I would expect the times to remain separated out.
Package version or git hash
Database output
ping_expires is a Unix timestamp. The starting point shown here has expires times between 11:35:24 & 11:36:17
20 minutes later many of the ping_expires are the same: (11:55:03)
The text was updated successfully, but these errors were encountered: