Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

raising exception in callback does not stop processes #15

Open
qwiglydee opened this issue Nov 5, 2015 · 0 comments
Open

raising exception in callback does not stop processes #15

qwiglydee opened this issue Nov 5, 2015 · 0 comments

Comments

@qwiglydee
Copy link

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant