You are viewing a plain text version of this content. The canonical link for it is here.
Posted to infrastructure-issues@apache.org by "Sebb (JIRA)" <ji...@apache.org> on 2015/09/03 13:42:46 UTC

[jira] [Commented] (INFRA-10242) closer.lua: can fail if mirrors.list isn't updated every day

    [ https://issues.apache.org/jira/browse/INFRA-10242?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14728895#comment-14728895 ] 

Sebb commented on INFRA-10242:
------------------------------

Unfortunately it appears that LUA has no built-in function to return the modfication date of a file (???!!!!).
However the file header comments include the date, e.g.
# date : Wed Sep  2 09:49:53 2015 [UTC]

> closer.lua: can fail if mirrors.list isn't updated every day
> ------------------------------------------------------------
>
>                 Key: INFRA-10242
>                 URL: https://issues.apache.org/jira/browse/INFRA-10242
>             Project: Infrastructure
>          Issue Type: Bug
>            Reporter: Sebb
>
> closer.lua only processes mirrors that have a last updated date in the last 24 hours. The date is taken from the mirrors.list file, so if that is not updated for a day then no mirrors will match - not even the backup ones.
> If no backup mirrors are found, then the script currently fails with:
> lua: ./closer.lua:114: attempt to index a nil value (local 'bmap')
> stack traceback:
> 	./closer.lua:114: in function 'handle'
> The previous version of the script (mirrors.cgi) took a different approach.
> It checked the date of mirrors.list, and only considered mirrors that were more than a day old relative to the date of the file. It also ignored the date for the backup mirrors, so these always matched.
> There are several issues here:
> 1) backup mirrors should not be subject to the staleness check
> 2) if no backup mirrors are found, the code should not crash
> 3) the staleness check needs to consider the date when the liveness data was last update
> Patch to follow



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)