Project

General

Profile

Bug #53898

Fix mDNS middleware traceback

Added by William Grzybowski almost 2 years ago. Updated almost 2 years ago.

Status:
Done
Priority:
No priority
Assignee:
William Grzybowski
Category:
Middleware
Seen in:
Severity:
Low Medium
Reason for Closing:
Reason for Blocked:
Needs QA:
No
Needs Doc:
No
Needs Merging:
No
Needs Automation:
No
Support Suite Ticket:
n/a
Hardware Configuration:
ChangeLog Required:
No

Description

future: <Task finished coro=<Middleware.call() done, defined at /usr/local/lib/python3.7/site-packages/middlewared/main.py:1026> exception=AttributeError("'NoneType' object has no attribute 'cancel'")>
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/middlewared/main.py", line 1028, in call
    return await self._call(name, serviceobj, methodobj, params, app=app, pipes=pipes, io_thread=True)
  File "/usr/local/lib/python3.7/site-packages/middlewared/main.py", line 979, in _call
    return await run_method(methodobj, *args)
  File "/usr/local/lib/python3.7/site-packages/middlewared/main.py", line 925, in run_in_thread
    return await self.loop.run_in_executor(executor, functools.partial(method, *args, **kwargs))
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.7/site-packages/middlewared/plugins/mdns.py", line 618, in start
    self.dthread = DiscoverThread(queue=self.dq, middleware=self.middleware, timeout=5)
  File "/usr/local/lib/python3.7/site-packages/middlewared/plugins/mdns.py", line 292, in __init__
    super(DiscoverThread, self).__init__(**kwargs)
  File "/usr/local/lib/python3.7/site-packages/middlewared/plugins/mdns.py", line 284, in __init__
    self.mdnsd.wait(timeout=10)
  File "/usr/local/lib/python3.7/site-packages/middlewared/plugins/mdns.py", line 210, in wait
    self.middleware.call_sync('mdnsbrowser.restart')
  File "/usr/local/lib/python3.7/site-packages/middlewared/main.py", line 1054, in call_sync
    return fut.result()
  File "/usr/local/lib/python3.7/concurrent/futures/_base.py", line 425, in result
    return self.__get_result()
  File "/usr/local/lib/python3.7/concurrent/futures/_base.py", line 384, in __get_result
    raise self._exception
  File "/usr/local/lib/python3.7/site-packages/middlewared/main.py", line 979, in _call
    return await run_method(methodobj, *args)
  File "/usr/local/lib/python3.7/site-packages/middlewared/main.py", line 925, in run_in_thread
    return await self.loop.run_in_executor(executor, functools.partial(method, *args, **kwargs))
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.7/site-packages/middlewared/plugins/mdns.py", line 646, in restart
    self.stop()
  File "/usr/local/lib/python3.7/site-packages/middlewared/plugins/mdns.py", line 634, in stop
    self.rthread.cancel()
AttributeError: 'NoneType' object has no attribute 'cancel'

Acceptance Criteria
After fresh install above traceback should not be seen on middlewared.log


Related issues

Copied to FreeNAS - Bug #54105: Fix mDNS middleware tracebackDone
Copied to FreeNAS - Bug #54324: Fix mDNS middleware tracebackClosed

Associated revisions

Revision 8b234b9a (diff)
Added by William Grzybowski almost 2 years ago

fix(middlewared/mdns): avoid traceback by making sure thread exists While I'm here improve lock syntax. Ticket: #53898

Revision 8a94c989 (diff)
Added by William Grzybowski almost 2 years ago

fix(middlewared/mdns): avoid traceback by making sure thread exists While I'm here improve lock syntax. Ticket: #53898

Revision 367451b9 (diff)
Added by William Grzybowski almost 2 years ago

fix(middlewared/mdns): avoid traceback by making sure thread exists While I'm here improve lock syntax. Ticket: #53898 (cherry picked from commit 8b234b9aad90c0a11bc078d9d66148c2fbadf463)

Revision 1f0f3bc5 (diff)
Added by William Grzybowski almost 2 years ago

fix(middlewared/mdns): do all thread manipulation within a lock This should avoid race conditions starting/stopping mdns. Ticket: #53898

Revision 7e1fec1e (diff)
Added by William Grzybowski almost 2 years ago

fix(middlewared/mdns): do all thread manipulation within a lock This should avoid race conditions starting/stopping mdns. Ticket: #53898

Revision 31758cb4 (diff)
Added by William Grzybowski almost 2 years ago

fix(middlewared/mdns): do all thread manipulation within a lock This should avoid race conditions starting/stopping mdns. Ticket: #53898 (cherry picked from commit 1f0f3bc5c7ea5d69da5d0ee5163a8703fdeae36c)

History

#1 Updated by Bug Clerk almost 2 years ago

  • Status changed from Not Started to In Progress

#2 Updated by Bug Clerk almost 2 years ago

  • Status changed from In Progress to Ready for Testing

#3 Updated by Bug Clerk almost 2 years ago

  • Target version changed from 11.2-RC2 to 11.3

#4 Updated by Bug Clerk almost 2 years ago

  • Copied to Bug #54105: Fix mDNS middleware traceback added

#5 Updated by Dru Lavigne almost 2 years ago

  • Subject changed from Fix mdns middleware tracebacks to Fix mDNS middleware traceback
  • Needs Doc changed from Yes to No
  • Needs Merging changed from Yes to No

#6 Updated by William Grzybowski almost 2 years ago

  • Status changed from Ready for Testing to In Progress

#7 Updated by Bug Clerk almost 2 years ago

  • Status changed from In Progress to Ready for Testing

#8 Updated by Bug Clerk almost 2 years ago

  • Copied to Bug #54324: Fix mDNS middleware traceback added

#9 Updated by Dru Lavigne almost 2 years ago

  • Target version changed from 11.3 to 11.2-RC2

#10 Updated by Dru Lavigne almost 2 years ago

  • Target version changed from 11.2-RC2 to 11.3

#11 Updated by Dru Lavigne almost 2 years ago

  • Status changed from Ready for Testing to Done
  • Target version changed from 11.3 to Master - FreeNAS Nightlies
  • Needs QA changed from Yes to No

Also available in: Atom PDF