Project

General

Profile

« Previous | Next » 

Revision 1649

inputs/REMIB/src/nodes.make: If a read times out, abort the entire node rather than just the prefix to avoid waiting 20 sec for each of 26*26 prefixes

View differences:

nodes.make
60 60
        
61 61
        filename = 'node.'+str(node_id)+'.specimens.csv'
62 62
        out = streams.LineCountOutputStream(open(filename, 'w'))
63
        def log_ex(e):
64
            clear_line()
65
            log('! Output line '+str(out.line_num)+': '+exc.str_(e))
63 66
        start_line_num = out.line_num
64 67
        node_url_template = url_template.replace('[node_id]', str(node_id))
65 68
        
......
96 99
                    row_ct += 1
97 100
                    if row_ct % 100 == 0: print_status('\r')
98 101
                        # CR at end so next print overwrites msg
99
            except (InputException, timeout.TimeoutException), e:
100
                clear_line()
101
                log('! Output line '+str(out.line_num)+': '+exc.str_(e))
102
            stream.close()
102
            except InputException, e: log_ex(e)
103
            except timeout.TimeoutException, e:
104
                log_ex(e)
105
                break # assume node is down, so abort node
106
            finally: # still run if break is called
107
                stream.close()
108
                
109
                profiler.add_iters(row_ct)
110
                print_status()
111
                log_indent -= 1
103 112
            
104
            profiler.add_iters(row_ct)
105
            print_status()
106
            log_indent -= 1
107
            
108 113
        profiler.stop()
109 114
        log(profiler.msg())
110 115
        log_indent -= 1

Also available in: Unified diff