Impacted versions:
tested with 11.0, but I assume all versions that have the autoreload feature

Steps to reproduce:
Start an odoo instance with the --dev=reload argument, and then start editing a python file with emacs while it is watched by odoo for changes.

Current behavior:
As soon emacs creates a lockfile, which is its default behaviour, in the same directory as the edited python file, the odoo instance will log a FileNotFoundError:

    skynet:~/odoo/odoo-git$ ./odoo-bin --addons-path="/home/rakete/odoo/addons,/home/rakete/odoo/odoo-git/odoo/addons,/home/rakete/odoo/odoo-git/addons" --dev=all
    2017-11-24 17:22:00,761 5806 INFO ? odoo: Odoo version 11.0
    2017-11-24 17:22:00,762 5806 INFO ? odoo: addons paths: ['/home/rakete/.local/share/Odoo/addons/11.0', '/home/rakete/odoo/addons', '/home/rakete/odoo/odoo-git/odoo/addons', '/home/rakete/odoo/odoo-git/addons']
    2017-11-24 17:22:00,762 5806 INFO ? odoo: database: default@default:default
    2017-11-24 17:22:00,768 5806 INFO ? odoo.service.server: Watching addons folder /home/rakete/.local/share/Odoo/addons/11.0
    2017-11-24 17:22:00,768 5806 INFO ? odoo.service.server: Watching addons folder /home/rakete/odoo/addons
    2017-11-24 17:22:00,768 5806 INFO ? odoo.service.server: Watching addons folder /home/rakete/odoo/odoo-git/odoo/addons
    2017-11-24 17:22:00,769 5806 INFO ? odoo.service.server: Watching addons folder /home/rakete/odoo/odoo-git/addons
    2017-11-24 17:22:00,830 5806 INFO ? odoo.service.server: AutoReload watcher running
    2017-11-24 17:22:00,830 5806 INFO ? odoo.service.server: HTTP service (werkzeug) running on 0.0.0.0:8069
    2017-11-24 17:22:00,891 5806 INFO ? odoo.addons.base.ir.ir_actions_report: You need Wkhtmltopdf to print a pdf version of the reports.
    Exception in thread Thread-1:
    Traceback (most recent call last):
      File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner
        self.run()
      File "/usr/lib/python3/dist-packages/watchdog/observers/api.py", line 199, in run
        self.dispatch_events(self.event_queue, self.timeout)
      File "/usr/lib/python3/dist-packages/watchdog/observers/api.py", line 368, in dispatch_events
        handler.dispatch(event)
      File "/home/rakete/odoo/odoo-git/odoo/service/server.py", line 138, in dispatch
        source = open(path, 'rb').read() + b'\n'
    FileNotFoundError: [Errno 2] No such file or directory: '/home/rakete/odoo/addons/hello_odoo/models/.#models.py'

Afterwards the odoo instance keeps running, but the autoreload feature stops working.

The reason for the FileNotFoundError is probably because what emacs creates as lockfile is not a regular file, but a broken symbolic link:

    skynet:~/odoo$ file addons/hello_odoo/models/.#models.py
    addons/hello_odoo/models/.#models.py: broken symbolic link to rakete@skynet.2238:1511177123
    skynet:~/odoo$

The problem can be worked around in emacs by setting:

    (setq create-lockfiles nil)

Expected behavior:
The autoreload feature should ignore emacs lockfiles, or more generally just ignore broken symbolic links.

import datetime
import errno
import logging
import os
import os.path
import platform
import random
import select
import signal
import socket
import subprocess
import sys
import threading
import time
import unittest
import werkzeug.serving
from werkzeug.debug import DebuggedApplication
if os.name == 'posix':