Project

General

Profile

Bug #24573

Change middlewared to use asyncio

Added by William Grzybowski over 1 year ago. Updated 12 months ago.

Status:
Resolved
Priority:
Critical
Assignee:
William Grzybowski
Category:
Middleware
Target version:
Seen in:
Sprint:
Severity:
New
Backlog Priority:
Reason for Closing:
Reason for Blocked:
Needs QA:
No
Needs Doc:
Yes
Needs Merging:
Yes
Needs Automation:
No
Support Suite Ticket:
n/a
Hardware Configuration:
ChangeLog Required:
No

Description

=====
Hello,

For those unaware, I have been working on porting our middleware
(middlewared) to use python asyncio [1].

This branch [2] is in the final stage of development (I am fixing a
few minor issues) and I was planning on merging that to master on
Friday.

In my opinion asyncio is a much more powerful "tool" to write
single-threaded concurrent code than gevent (what we currently use).

One can't really compare asyncio and gevent on a 1:1 basis because
gevent is built on top of greenlet (another event loop implementation,
so it would make more sense to compare asyncio to that). Both provide
co-routines in python, however asyncio does things explicitly as
opposed to implicitly on gevent (by monkey patching python system
modules).

That allow us to take more advantage of process/thread pool without
having to worry with system modules being patched and block the event
loop.

That being said, I would like to urge anyone working on middlewared or
python-savvy to take a look at the diff [2] and tell me if you have
any concerns.

[1] https://docs.python.org/3/library/asyncio.html
[2] https://github.com/freenas/freenas/compare/feature/asyncio

Thanks! ====


Related issues

Related to FreeNAS - Bug #26204: Traceback error related to scheduled scrubsClosed: Duplicate2017-10-16

Associated revisions

Revision 85b373a7
Added by William Grzybowski over 1 year ago

Merge branch 'feature/asyncio'

Ticket: #24573

Revision 47d9a906 (diff)
Added by Dru Lavigne about 1 year ago

Mention asyncio.
Ticket: #24573

History

#1 Updated by William Grzybowski over 1 year ago

  • Status changed from Fix In Progress to Resolved

feature/asyncio branch has been merged

#2 Updated by William Grzybowski over 1 year ago

  • Status changed from Resolved to Ready For Release

#3 Updated by Dru Lavigne about 1 year ago

  • Target version changed from 11.1 to 11.1-BETA1

#4 Updated by William Grzybowski about 1 year ago

  • Related to Bug #26204: Traceback error related to scheduled scrubs added

#5 Updated by Dru Lavigne 12 months ago

  • Status changed from Ready For Release to Resolved

#6 Updated by William Grzybowski 12 months ago

  • Needs QA changed from Yes to No

Also available in: Atom PDF