Skip to content

Conversation

parth-soni07
Copy link
Contributor

What was wrong?

Issue #723

How was it fixed?

Modified the read() and write() methods to actually check and enforce the deadlines.

@paschal533
Copy link
Contributor

paschal533 commented Oct 17, 2025

Hi @parth-soni07 , thanks for the quick fixes. The code looks great now. You've resolved the duplicate receive issue and the EOF reading is now using the timeout version like it should.

I also noticed you moved the ReadWriteLock to its own module which is a nice improvement for code organization.

The deadline handling is now working properly throughout the read and write operations, and the error messages are clear and helpful. This is good to merge. Nice work getting the deadline functionality working, this has been a TODO for a while. CC @seetadev and @pacrob

@parth-soni07
Copy link
Contributor Author

Hi @parth-soni07 , thanks for the quick fixes. The code looks great now. You've resolved the duplicate receive issue and the EOF reading is now using the timeout version like it should.

I also noticed you moved the ReadWriteLock to its own module which is a nice improvement for code organization.

The deadline handling is now working properly throughout the read and write operations, and the error messages are clear and helpful. This is good to merge. Nice work getting the deadline functionality working, this has been a TODO for a while. CC @seetadev and @pacrob

Hey @paschal533 , thank you for your review! :)

@seetadev
Copy link
Contributor

@parth-soni07 : Appreciate your efforts and contribution. Doing a detailed review. Will share feedback soon.

Also, CCing @acul71 and @Jineshbansal, who were working on this feature earlier.

Wish if you could resolve the merge conflicts. Once resolved, please ping me.

I will re-run the CI/CD pipeline and share test results soon.

@pacrob
Copy link
Member

pacrob commented Oct 20, 2025

Good work, @parth-soni07! This still needs a newsfragment and testing to verify things are working as expected and to prevent regression.

@acul71
Copy link
Contributor

acul71 commented Oct 21, 2025

@parth-soni07
Is this merged PR related ?
#987

Implement MplexStream read and write deadline timeout enforcement #987
Merged
acul71 merged 3 commits into libp2p:main from bomanaps:fix/mplexstream yesterday

@@ -1,3 +1,4 @@
import time
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may use trio.current_time() instead of time.time().
time.time() returns wall-clock time, which can jump backward or forward if the system clock changes (e.g., due to NTP).
trio.current_time() is monotonic and stable, making it the safer choice for deadlines and timeouts in async code.

@parth-soni07
Copy link
Contributor Author

parth-soni07 commented Oct 21, 2025

@parth-soni07 Is this merged PR related ? #987

Implement MplexStream read and write deadline timeout enforcement #987 Merged acul71 merged 3 commits into libp2p:main from bomanaps:fix/mplexstream yesterday

Hey @acul71 , thanks for pointing this out, yes the #987 does what this PR was supposed to do as I analysed it. @seetadev , I think @bomanaps excellently handled this and this PR #995 can be safely closed since the issue seems fixed.

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.

6 participants