Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Defer feeding XML data until we likely trigger an event #29

Merged
merged 1 commit into from
Mar 18, 2024

Conversation

cottsay
Copy link
Owner

@cottsay cottsay commented Mar 17, 2024

Recent changes to expat, the XML parser behind the Python XMLPullParser, utilize a backoff when feeding the parser in small chunks which don't (yet) constitute something interesting. Unfortunately, this could result in the parser sitting on a completed payload waiting for more data before it attempts parsing.

The safest mitigation I can find is to just wait until we get a '>' before feeding the parser, which should hopefully mean that we'll never trigger the backoff.

See python/cpython#115133 for related comments.

Recent changes to expat, the XML parser behind the Python XMLPullParser,
utilize a backoff when feeding the parser in small chunks which don't
(yet) constitute something interesting. Unfortunately, this could result
in the parser sitting on a completed payload waiting for more data
before it attempts parsing.

The safest mitigation I can find is to just wait until we get a '>'
before feeding the parser, which should hopefully mean that we'll never
trigger the backoff.
@cottsay cottsay added the bug Something isn't working label Mar 17, 2024
@cottsay cottsay self-assigned this Mar 17, 2024
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 85.71429% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 86.97%. Comparing base (01472b9) to head (f134026).

Files Patch % Lines
aioraven/protocols.py 85.71% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #29      +/-   ##
==========================================
- Coverage   87.00%   86.97%   -0.03%     
==========================================
  Files           7        7              
  Lines         800      806       +6     
==========================================
+ Hits          696      701       +5     
- Misses        104      105       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cottsay cottsay merged commit b361b1c into main Mar 18, 2024
16 checks passed
@cottsay cottsay deleted the defer-xml-feed branch March 18, 2024 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants