Skip to content
New issue

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

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

Already on GitHub? # to your account

Постоянные дисконнекты при запуске dronpoint_flight.py #80

Open
mituritsyn opened this issue May 22, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@mituritsyn
Copy link

Шаги по воспроизведению:

  1. настраиваем клиент и сервер в соответствии с инструкцией
  2. переходим в ветку ws2020
  3. запускаем клевер и server.py, дожидаемся отображения клевера на сервере
  4. запускаем на клиенте dronpoint_flight.py
    Ожидаем, небольшой выхлоп лога о подключении, далее чистый терминал с логгированием сообщений сервера

На деле, получаем постоянные сбросы сессии с реконнектом:
2021-05-22 11:40:22,566 [messagi] [MainThread ] [DEBUG] Registered message function <function dronepoint_callback at 0x765900b0> for dronepoint
2021-05-22 11:40:22,615 [modules] [MainThread ] [INFO ] Config loaded
2021-05-22 11:40:22,616 [modules] [MainThread ] [INFO ] Starting client
2021-05-22 11:40:22,618 [messagi] [MainThread ] [INFO ] Notify socket: connected
2021-05-22 11:40:22,619 [messagi] [MainThread ] [INFO ] Notify socket: selector registered
2021-05-22 11:40:22,619 [modules] [MainThread ] [INFO ] Trying to connect to 192.168.1.113:25000 ...
2021-05-22 11:40:22,620 [modules] [MainThread ] [INFO ] Waiting for connection, attempt 0
2021-05-22 11:40:22,645 [modules] [MainThread ] [INFO ] Connection to server successful!
2021-05-22 11:40:22,647 [messagi] [MainThread ] [DEBUG] Switched selector of ('192.168.1.113', 25000) to mode 1
2021-05-22 11:40:22,664 [messagi] [MainThread ] [DEBUG] Received 200 bytes from ('192.168.1.113', 25000)
2021-05-22 11:40:22,669 [messagi] [MainThread ] [DEBUG] Received message! Header: OrderedDict([(u'byteorder', u'little'), (u'content-type', u'json'), (u'content-encoding', u'utf-8'), (u'content-length', 73), (u'message-type', u'request')]), content: OrderedDict([(u'requested_value', u'id'), (u'request_id', u'2908'), (u'args', []), (u'kwargs', OrderedDict())])
2021-05-22 11:40:22,671 [messagi] [MainThread ] [DEBUG] Switched selector of ('192.168.1.113', 25000) to mode 3
2021-05-22 11:40:22,672 [messagi] [MainThread ] [DEBUG] Notify socket: notified
2021-05-22 11:40:22,674 [messagi] [MainThread ] [DEBUG] Sent message to ('192.168.1.113', 25000): sent 195 bytes, 0 bytes left.
2021-05-22 11:40:22,675 [messagi] [MainThread ] [DEBUG] Notify socket: received
2021-05-22 11:40:22,676 [messagi] [MainThread ] [DEBUG] Switched selector of ('192.168.1.113', 25000) to mode 1
2021-05-22 11:40:22,683 [modules] [MainThread ] [ERROR] Exception [Errno 104] Connection reset by peer occurred for ('192.168.1.113', 25000)! Resetting connection!
2021-05-22 11:40:22,684 [messagi] [MainThread ] [INFO ] Closing connection to ('192.168.1.113', 25000)
2021-05-22 11:40:22,684 [messagi] [MainThread ] [INFO ] Unregistering selector of ('192.168.1.113', 25000)
2021-05-22 11:40:22,685 [messagi] [MainThread ] [INFO ] Closing socket of of ('192.168.1.113', 25000)
2021-05-22 11:40:22,686 [messagi] [MainThread ] [INFO ] CLOSED connection to ('192.168.1.113', 25000)
2021-05-22 11:40:22,687 [modules] [MainThread ] [WARNI] No active connections left!
2021-05-22 11:40:22,688 [modules] [MainThread ] [INFO ] Trying to connect to 192.168.1.113:25000 ...

И так до бесконечности.

Проблема изрядно попортила нервы в ходе отборочного чемпионата WS. В одной и той же сетке у разных участников могло воспроизвестись или не воспроизвестись. По возвращении домой воспроизвел на виртуалке clover-devel_v0.20 и свежезаписанном образе clever-show.

Также не помогли изменения предложенные @artem30801 :

В клиенте и сервере нужно изменить файл clever-show/lib/messaging.py
58 строка: def set_keepalive(sock, after_idle_sec=1, interval_sec=3, max_fails=5):
заменить на
def set_keepalive(sock, after_idle_sec=10, interval_sec=15, max_fails=10):
и:
В файле drone/modules/client_core.py
220 строка:
events = self.selector.select(timeout=1)
заменить на
events = self.selector.select(timeout=10)
В файле
server/modules/server_core.py
146 строка (аналогично):
events = self.sel.select(timeout=1)
заменить на
events = self.selector.select(timeout=10)

@mituritsyn mituritsyn added the bug Something isn't working label May 22, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant