Skip to content

raising exception in callback does not stop processes #15

@qwiglydee

Description

@qwiglydee
import sys
from imposm.parser import OSMParser

def callback(data):
    raise Exception("I'm broken")

parser = OSMParser(relations_callback=callback, concurrency=1)
try:
    parser.parse_pbf_file("var/RU.osm.pbf")
except Exception as e:
    print(e)
    print("now you have to press ctrl-c")
    print("or kill all three processes with signal")

sys.exit(100500) # does not help
Traceback (most recent call last):
  File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
    self.run()
  File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
    self._target(*self._args, **self._kwargs)
  File "/home/qmax/Work/regions/.env/local/lib/python2.7/site-packages/imposm/parser/simple.py", line 113, in parse_it
    parser.parse(input)
  File "/home/qmax/Work/regions/.env/local/lib/python2.7/site-packages/imposm/parser/pbf/multiproc.py", line 70, in parse
    pos_queue.put(pos)
  File "/usr/lib/python2.7/multiprocessing/queues.py", line 311, in put
    if not self._sem.acquire(block, timeout):
KeyboardInterrupt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions