#7142 Better conditional around sending zarkov events

v1.2.0
closed
bitesize (76)
General
2015-08-20
2014-02-06
No

Zarkov events are optional, but the code just checks to see if the 'zmq' lib is installed and it should really be checking to see if zarkov.host is configured. If zmq is installed but zarkov.host is not configured (and a zarkov is not listening) then it'll hang as shown below. Fix should be around app_globals.py line 338

"/home/jetmind/p/42cc/allura/sourceforge-allura/Allura/allura/app.py", line
464, in install
    session(discussion).flush()
  File
"/home/jetmind/.virtualenvs/allura/local/lib/python2.7/site-packages/ming/odm/base.py",
line 30, in inner
    call_hook(obj, after_meth, *args, **kwargs)
  File
"/home/jetmind/.virtualenvs/allura/local/lib/python2.7/site-packages/ming/odm/base.py",
line 16, in call_hook
    getattr(e, hook_name)(*args, **kw)
  File
"/home/jetmind/p/42cc/allura/sourceforge-allura/Allura/allura/model/session.py",
line 75, in after_flush
    g.zarkov_event('create', extra=obj.index_id())
  File
"/home/jetmind/p/42cc/allura/sourceforge-allura/Allura/allura/lib/app_globals.py",
line 365, in zarkov_event
    self._zarkov.event(event_type, context, extra)
  File
"/home/jetmind/p/42cc/allura/sourceforge-allura/Allura/allura/lib/zarkov_helpers.py",
line 38, in event
    self._sock.send(bson.BSON.encode(obj))
  File "socket.pyx", line 530, in zmq.core.socket.Socket.send
(zmq/core/socket.c:4905)
  File "socket.pyx", line 577, in zmq.core.socket.Socket.send
(zmq/core/socket.c:4673)
  File "socket.pyx", line 174, in zmq.core.socket._send_copy
(zmq/core/socket.c:1915)
  File "checkrc.pxd", line 11, in zmq.core.checkrc._check_rc
(zmq/core/socket.c:5511)
  File
"/home/jetmind/.virtualenvs/allura/local/lib/python2.7/site-packages/async/__init__.py",
line 21, in thread_interrupt_handler
    prev_handler(signum, frame)
KeyboardInterrupt

Discussion

  • Dave Brondsema

    Dave Brondsema - 2014-02-14
    • status: open --> code-review
    • assigned_to: Dave Brondsema
    • Milestone: forge-backlog --> forge-feb-21
     
  • Dave Brondsema

    Dave Brondsema - 2014-02-14

    Fix in db/7142

     
    • QA: Tim Van Steenburgh
     
    • status: code-review --> closed
     
  • Dave Brondsema

    Dave Brondsema - 2015-01-05
    • Milestone: unreleased --> asf_release_1.2.0
     

Log in to post a comment.