[asterisk-dev] [Code Review] 3575: config: Fix config files not reloading when only an included file changes.

wdoekes reviewboard at asterisk.org
Mon Jun 2 02:04:29 CDT 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/3575/#review12022
-----------------------------------------------------------


I didn't read the code, but:

> Made sip.conf include several specific files.  The config was reloaded when any file was touched.

What about includes in included files?

It's legal to do this right?

  sip.conf:
  #include "something.inc"

  something.inc:
  #include "another.inc"

CLI> !touch another.inc
CLI> sip reload

- wdoekes


On May 30, 2014, 5:39 p.m., rmudgett wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/3575/
> -----------------------------------------------------------
> 
> (Updated May 30, 2014, 5:39 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Bugs: ASTERISK-23683
>     https://issues.asterisk.org/jira/browse/ASTERISK-23683
> 
> 
> Repository: Asterisk
> 
> 
> Description
> -------
> 
> The twisted logic determining if a config file should be reloaded was mostly broken and disabled.  The incorrect test that ASTERISK-23383 fixed actually reenabled the broken logic.  The incorrect test was causing the timestamp to always be cleared which caused config files with includes to always be reloaded.
> 
> * Made wildcard includes always cause a reload.  Determining if a file was deleted cannot be determined without restructuring the cache to determine if any files are missing from the last files actually loaded.  Also without refactoring config_text_file_load(), the glob loop couldn't check more than one file for changes anyway.
> 
> * Made remove the cache entry if the file no longer exists when trying to get its timestamp or it is no longer a regular file.  This fixes the corner case where the file was loaded, then deleted, then the config reloaded, then the file restored with the same timestamp, and then the config reloaded again.
> 
> * Made remove the cache entry include list when actually loading the file.  This gets rid of any stale includes the file had from the last time the file was loaded.
> 
> 
> Diffs
> -----
> 
>   /branches/1.8/main/config.c 414961 
> 
> Diff: https://reviewboard.asterisk.org/r/3575/diff/
> 
> 
> Testing
> -------
> 
> Made sip.conf include a wildcard pattern.  The config was always reloaded even if no files were touched.
> 
> Made sip.conf include several specific files.  The config was reloaded when any file was touched.
> 
> Edited sip.conf to change which files the file included.  Verified with debug statements added to determine that the old include files were no longer checked on subsequent reload attempts.
> 
> 
> Thanks,
> 
> rmudgett
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20140602/f42ab007/attachment.html>


More information about the asterisk-dev mailing list