From 6c41741c6bddc5ef961a72b05dcb63bdd972f276 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Sat, 17 Jun 2017 13:31:58 -0700 Subject: [PATCH] Add monkey patch notes --- source/_posts/2017-06-17-release-47.markdown | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/source/_posts/2017-06-17-release-47.markdown b/source/_posts/2017-06-17-release-47.markdown index 8253e92ea8b..933905763af 100644 --- a/source/_posts/2017-06-17-release-47.markdown +++ b/source/_posts/2017-06-17-release-47.markdown @@ -42,6 +42,22 @@ Z-Wave is also getting a big update in this release. The confusing entity_ids wi 6. Restart Home Assistant to run with new IDs. 7. The old entity IDs will be available in the more info dialog to trace down any remaining errors. +## {% linkable_title Monkey Patching Python 3.6 %} + +Some people have noticed that running Home Assistant under Python 3.6 can lead to segfaults. It seems to be related to the [earlier segfault issues][old-bug] that we experienced when we released the asyncio-based core. We thought that those issues would have been fixed when [Python bug 26617] was resolved. Although we see less reports compared to the old bug, there are still users [experiencing them][new-bug] ([gdb stacktrace points at `PyObject_GC_Del()`][gdb]). + +Since Python 3.6, the Task and Future classes have been moved to C. This gives a nice speed boost but also prevents us from monkey patching the Task class to avoid the segfault. [Ben Bangert] managed to brew up another monkey patch to stop Python 3.6 from using the C classes, falling back to the Python versions instead. This allows us to apply the original monkey patch again. + +Both monkey patches are now active by default starting version 0.47 to avoid our users experiencing segfaults. This comes at a cost of not being able to benefit from all optimizations that were introduced in Python 3.6. + +To run without the monkey patch, start Home Assistant with `HASS_NO_MONKEY=1 hass`. We will further investigate this issue and try to fix it in a future version of Python. + +[old-bug]: https://github.com/home-assistant/home-assistant/issues/3453 +[Python bug 26617]: https://bugs.python.org/issue26617 +[new-bug]: https://github.com/home-assistant/home-assistant/issues/7752 +[gdb]: https://github.com/home-assistant/home-assistant/issues/7752#issuecomment-305100009 +[Ben Bangert]: https://github.com/bbangert + ## {% linkable_title New platforms %} - Added a Taps Aff binary sensor ([@bazwilliams] - [#7880]) ([binary_sensor.tapsaff docs]) (new-platform)