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

Release async read write for tokio v0.4.0 #20

Merged
merged 45 commits into from
Nov 28, 2024
Merged

Conversation

GunnarMorrigan
Copy link
Owner

@GunnarMorrigan GunnarMorrigan commented Nov 28, 2024

This change uses async reading and writing more heavily. In the past (and still for smol) data was copied to a buffer.
Parse attempts were made, these could fail and in some cases warrant a retry. For example, when not enough data is present parsing is aborted and should be retried.

This is problematic on slower connections where data comes in chunks, multiple parse attempts could be made for a single message. Due to applying async this is not the case anymore.

Writing should not see much difference

Use a buffered stream! :)

Other changes:

  • Several tiny fixes
  • Fuzzed the async reader to find subtle bugs (remove 2 crashing bugs)

GunnarMorrigan and others added 30 commits July 12, 2024 23:39
Especially if the reader is not buffered this will cause a lot of sys read calls. If the IO is buffered your ok.
The current reading into a buffer and then attempting to deserialize from it is a bit tideious.
The approach is complicated and usecase minimal. Thus removing
Removing concurrent event handler
Renaming mutable event handler to normal event handler
Benchmarks are being removed as they are not possible anymore with the public api.
Additionally, they are not as up to date anymore
@GunnarMorrigan GunnarMorrigan changed the title Release/async io wip Release async read write for tokio v0.4.0 Nov 28, 2024
Copy link

codecov bot commented Nov 28, 2024

Codecov Report

Attention: Patch coverage is 88.17577% with 409 lines in your changes missing coverage. Please review.

Project coverage is 88.07%. Comparing base (efe77c9) to head (634e05b).

Files with missing lines Patch % Lines
mqrstt/src/packets/mqtt_trait/primitive_impl.rs 67.92% 68 Missing ⚠️
mqrstt/src/packets/connack/properties.rs 80.11% 35 Missing ⚠️
mqrstt/src/packets/connect/last_will_properties.rs 56.57% 33 Missing ⚠️
mqrstt/src/packets/puback/mod.rs 51.02% 24 Missing ⚠️
mqrstt/src/packets/unsuback/properties.rs 41.17% 20 Missing ⚠️
mqrstt/src/packets/primitive/qos.rs 57.14% 18 Missing ⚠️
mqrstt/src/packets/primitive/variable_integer.rs 90.62% 18 Missing ⚠️
mqrstt/src/packets/connect/mod.rs 95.90% 17 Missing ⚠️
mqrstt/src/packets/pubcomp/mod.rs 69.23% 16 Missing ⚠️
mqrstt/src/packets/publish/mod.rs 91.12% 15 Missing ⚠️
... and 27 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #20      +/-   ##
==========================================
+ Coverage   79.70%   88.07%   +8.36%     
==========================================
  Files          32       51      +19     
  Lines        5850     5998     +148     
==========================================
+ Hits         4663     5283     +620     
+ Misses       1187      715     -472     

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

@GunnarMorrigan GunnarMorrigan merged commit 9108239 into main Nov 28, 2024
11 checks passed
@GunnarMorrigan GunnarMorrigan deleted the release/async_io_wip branch December 3, 2024 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant