Skip to content

Failure in siteupdate.py reported much later #162

Closed

Description

@jteresco

Recent changes have meant that when a data error slips in, the "ABORTING due to N errors" doesn't happen until after (the time consuming) generation of all the subgraphs. I had gotten used to being able to ignore the site update process once graph generation started. I'd like to see about getting that ABORTING condition moved back earlier so I have a better chance to notice the problem. I just about was calling it a night when I noticed tonight's update had failed. I'll try to check this out soon but wouldn't be sad if @yakra beat me to it.

Activity

  1. yakra commented on Jan 6, 2019

    @yakra
    Contributor

    The final call to el.add_error is after reading datacheckfps.csv, if we're unable to parse a datacheckfps.csv line.
    We could move

    # first, read in the false positives list
    with open(args.highwaydatapath+"/datacheckfps.csv", "rt",encoding='utf-8') as file:
    lines = file.readlines()
    lines.pop(0) # ignore header line
    datacheckfps = []
    datacheck_always_error = [ 'DUPLICATE_LABEL', 'HIDDEN_TERMINUS',
    'LABEL_INVALID_CHAR', 'LABEL_SLASHES',
    'LONG_UNDERSCORE', 'MALFORMED_URL',
    'NONTERMINAL_UNDERSCORE' ]
    for line in lines:
    fields = line.rstrip('\n').split(';')
    if len(fields) != 6:
    el.add_error("Could not parse datacheckfps.csv line: " + line)
    continue
    if fields[4] in datacheck_always_error:
    print("datacheckfps.csv line not allowed (always error): " + line)
    continue
    datacheckfps.append(fields)
    # See if we have any errors that should be fatal to the site update process
    if len(el.error_list) > 0:
    print("ABORTING due to " + str(len(el.error_list)) + " errors:")
    for i in range(len(el.error_list)):
    print(str(i+1) + ": " + el.error_list[i])
    sys.exit(1)

    earlier, and just have the info hang around during graph generation until we need it.
    (It's a smaller & simpler diff than, say, moving all the subgraph generation to the very end...)
    Makes sense to me to move it before
    # Build a graph structure out of all highway data in active and
    # preview systems

    and keep all the graph generation-related code together in one place (as opposed to moving it immediately before subgraph generation, after master graph setup).

    If we wanted to move this even earlier in the process, it could go after reading the WPT files (the previous call to el.add_error is here), before sorting waypoints in Quadtree.

  2. yakra commented on Jan 6, 2019

    @yakra
    Contributor

    I think I prefer moving the code to the later point, just before graph generation, as the more future-proof option, in case we add more el.add_errors later.

    being able to ignore the site update process once graph generation started

    @jteresco, is this the only/main crucial crucial change here?

  3. michihdeu commented on Jan 6, 2019

    @michihdeu
    Contributor

    Isn't it possible to check whether there is an error and abort after wpt files are read? Most of the errors happen here (caused by csv file errors). The check for errors can be done later again.

  4. jteresco commented on Jan 6, 2019

    @jteresco
    ContributorAuthor

    Let's put it as late as possible to catch as many current and future unrecoverable errors, so right before graph generation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions