Skip to content

Revert orjson to v3.8.3#88935

Closed
mgjbroadbent wants to merge 1 commit into
home-assistant:devfrom
mgjbroadbent:revert-orjson-383
Closed

Revert orjson to v3.8.3#88935
mgjbroadbent wants to merge 1 commit into
home-assistant:devfrom
mgjbroadbent:revert-orjson-383

Conversation

@mgjbroadbent
Copy link
Copy Markdown
Contributor

Proposed change

The orjson package has a number of issues that result in segmentation faults in the versions 3.8.4 through 3.8.6 on musl based builds. Rather than incrementing up the versions, revert back to the last known good version (v3.8.3) until the outstanding issues are resolved.

Recommend this change for the next release increment.

Type of change

  • Dependency upgrade downgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast homeassistant tests)
  • n/a Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • Untested files have been added to .coveragerc.

To help with the load of incoming pull requests:

@mgjbroadbent mgjbroadbent requested a review from a team as a code owner February 28, 2023 20:47
@home-assistant home-assistant Bot added cla-signed core small-pr PRs with less than 30 lines. labels Feb 28, 2023
The orjson package has a number of issues that result in segmentation
faults in the versions 3.8.4 through 3.8.6 on musl based builds. Rather
than incrementing up the versions, revert back to the last known good
version (v3.8.3) until the outstanding issues are resolved.
@frenck
Copy link
Copy Markdown
Member

frenck commented Feb 28, 2023

revert back to the last known good version (v3.8.3) until the outstanding issues are resolved.

This part of the statement makes no sense, according to history, we have never shipped this version. We had it in dev, but never reached beta or stable.

The cases of 3.8.6 seem rare to trigger and more of an edge case. I haven't seen new reports since we shipped that? Why do we need to revert now?

Also, 3.8.7 was released today, doesn't that address it?

(ps: CI is failing).

@mgjbroadbent
Copy link
Copy Markdown
Contributor Author

revert back to the last known good version (v3.8.3) until the outstanding issues are resolved.

This part of the statement makes no sense, according to history, we have never shipped this version. We had it in dev, but never reached beta or stable.

I picked this version based on your suggestion in #87283, happy to recreate this PR for 3.8.1 instead. I have tested 3.8.3 and is working

The cases of 3.8.6 seem rare to trigger and more of an edge case. I haven't seen new reports since we shipped that? Why do we need to revert now?

I forgot to mention in the PR but I tested with 3.8.6 and saw 2 crashes in 24 hours with orjson being the cause. Using 3.8.3, this has been stable for over 48 hours.

Also, 3.8.7 was released today, doesn't that address it?

I haven’t tested this version to confirm.

(ps: CI is failing).

This appears to be related to unsigned package repositories rather than this change. Not sure how I can fix this.

@epenet
Copy link
Copy Markdown
Contributor

epenet commented Feb 28, 2023

https://github.com/ijl/orjson/issues/348 seems to have a reproducible scenario. Are you able to test that scenario with 3.8.6 and 3.8.7 on your environment?

@mgjbroadbent
Copy link
Copy Markdown
Contributor Author

ijl/orjson#348 seems to have a reproducible scenario. Are you able to test that scenario with 3.8.6 and 3.8.7 on your environment?

I should be able to test this, I’ll update once I’ve completed it.

@epenet epenet marked this pull request as draft February 28, 2023 22:39
@barrelltitor
Copy link
Copy Markdown

I tested with 3.8.6 and I keep getting crashes every single time I use certain scripts. I've been pulling my hairs out trying to get this sorted out. Reverting to 3.8.4 fixed all the crashes for me and no more Segmentation Faults appeared

@mgjbroadbent
Copy link
Copy Markdown
Contributor Author

mgjbroadbent commented Mar 2, 2023

I'v tested on raspi 64bit with the python:3.10-alpine3.16 container.

Using the test from ill/orjson#348, I can reproduce the segmentation fault when using v3.8.6, with v3.8.7 there is no crash. Looking at the change between these versions it reverts, for non glibc/macOS builds, the changes that cause issues on musl targets. This was the aim of this PR so it should be safe to update to 3.8.7 which I can test.

@epenet / @frenck - I can close this PR in preference for one that updates to v3.8.7. However, the wheel for orjson 3.8.7 is not published in https://wheels.home-assistant.io/musllinux/ despite it being merged in home-assistant/wheels#513. Are you able to help fix this?

/ # pip install 'orjson==3.8.6'
Collecting orjson==3.8.6
  Downloading orjson-3.8.6-cp310-cp310-musllinux_1_1_aarch64.whl (318 kB)
Installing collected packages: orjson
Successfully installed orjson-3.8.6
/ # python b.py 
Segmentation fault (core dumped)
/ # 
/ # pip install 'orjson==3.8.7'
Collecting orjson==3.8.7
  Downloading orjson-3.8.7-cp310-cp310-musllinux_1_1_aarch64.whl (324 kB)
Installing collected packages: orjson
Successfully installed orjson-3.8.7
/ # python b.py 
/ # 

@frenck frenck mentioned this pull request Mar 2, 2023
19 tasks
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla-signed core small-pr PRs with less than 30 lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Home Assistant keeps restarting after lates 2023.02 After Update to 2023.02 HomeAssistant restarts itself

4 participants