Summary:ASTERISK-10960: [patch] Don't reload the configuration if the .conf hasn't change
Reporter:Eliel Sardanons (eliel)Labels:
Date Opened:2007-12-03 16:17:04.000-0600Date Closed:2011-06-07 14:10:05
Versions:Frequency of
Environment:Attachments:( 0) cdr_adaptive_odbc.c.patch
Description:Check if file changed before reloading the configuration.
Comments:By: Tilghman Lesher (tilghman) 2007-12-03 16:47:28.000-0600

The current code is done SPECIFICALLY to ensure that on reload that you re-read the table structure from the database, since the config file specifies a MINIMUM of the elements necessary.  As structured, this patch INTRODUCES a bug, since it fails to re-read the database on reload.

This is not to say that the concept couldn't be done, but this patch is fatally flawed as written.

By: Eliel Sardanons (eliel) 2007-12-03 21:03:33.000-0600

Sorry, you are right, I didn't read the documentation in the .conf saying that a reload is only needed to re-read the table schema. What I was thinking was to leave that to a module unload/load.
I will rework my patch.

By: Eliel Sardanons (eliel) 2007-12-03 21:39:33.000-0600

hmm, I think the only way of doing this is:
1- marking every 'entry' in every 'table' as old.
2- Going throw the table schema and updating every 'entry' type in the memory structure and adding new columns.
3- Going throw the memory structure and destroying every 'entry' not updated (marked as old).

If this is the only way we don't gain to match not parsing the config file and doing all this stuff.

By: Tilghman Lesher (tilghman) 2007-12-03 22:19:28.000-0600

That is precisely why I didn't do that in the first place.

By: Eliel Sardanons (eliel) 2007-12-03 22:27:54.000-0600

Ok, You could close this issue, I make a mistake here. Sorry