{"push_id":952547650,"size":1,"distinct_size":1,"ref":"refs/heads/master","head":"63518d9b6bf2235d56875083d309214e27bf1049","before":"1b1bb2071800ead52eb26fdff045d09e9dce48fc","commits":[{"sha":"63518d9b6bf2235d56875083d309214e27bf1049","author":{"email":"c5f5e4d75252d9788ce20300d00023fa1ccd4d19@univention.de","name":"Florian Best"},"message":"Fix KeyError if socket is removed in timer\n\nThe following script demonstrates a KeyError which is caused if a socket which currently has some pending input/output was removed in a notifier timer.\nThe problem is that step() first poll()s, then executes the timers() and then uses the polled FD's.\n\n$ cat timer_bug.py\nimport notifier\nimport subprocess\nnotifier.init()\n\nfd = None\ndef on_read(sock):\n        print 'on_read'\n        return True\ndef on_timer():\n        print 'on_timer'\n        notifier.socket_remove(fd)\n        return True\np = subprocess.Popen('python -c \"import sys; sys.stdin.read()\"', shell=True, stdin=subprocess.PIPE)\nfd = p.stdin.fileno()\nnotifier.socket_add(fd, on_read)\nnotifier.timer_add(0, on_timer)\np.communicate('A')\nnotifier.step()\n\n$ python timer_bug.py\non_timer\nTraceback (most recent call last):\n  File \"timer_bug.py\", line 18, in <module>\n    notifier.step()\n  File \"/home/git/python-notifier/notifier/nf_generic.py\", line 259, in step\n    sock_obj = __sock_objects[ fd ]\nKeyError: 4","distinct":true,"url":"https://api.github.com/repos/spaceone/python-notifier/commits/63518d9b6bf2235d56875083d309214e27bf1049"}]}