Skip to content

fix: fix infinite busy-loop in RPLidar _read_response on device disconnect#2144

Open
andrewshab3 wants to merge 5 commits intoOpenMind:mainfrom
andrewshab3:fix-loop
Open

fix: fix infinite busy-loop in RPLidar _read_response on device disconnect#2144
andrewshab3 wants to merge 5 commits intoOpenMind:mainfrom
andrewshab3:fix-loop

Conversation

@andrewshab3
Copy link

Type of change

  • Bug fix
  • New feature
  • Documentation improvement
  • Bounty issue submission
  • Other:

Changes

  • _read_response hung forever when USB-LIDAR was disconnected — no timeout, no error handling on inWaiting()
  • The worker multiprocessing.Process could never check control_queue for "STOP", making graceful shutdown impossible
  • Added a 5s timeout via time.monotonic() deadline and OSError catch on inWaiting(), both raising RPLidarException which is already handled by rplidar_processor

Checklist

  • Code complies with style guidelines
  • Self-review completed
  • Documentation updated (if applicable)
  • Local testing completed
  • Tests added/updated (if applicable)

@andrewshab3 andrewshab3 requested review from a team as code owners February 6, 2026 17:00
@github-actions github-actions bot added robotics Robotics code changes python Python code labels Feb 6, 2026
@0xbyt4
Copy link
Collaborator

0xbyt4 commented Feb 6, 2026

Hi @andrewshab3 , Thanks for contribution ! Could you add unit tests for the new behavior

Added tests for RPLidar driver response handling, including timeout and device disconnection scenarios.
@andrewshab3 andrewshab3 requested a review from a team as a code owner February 6, 2026 18:06
@github-actions github-actions bot added the tests Test files label Feb 6, 2026
@andrewshab3
Copy link
Author

Hi @andrewshab3 , Thanks for contribution ! Could you add unit tests for the new behavior

Done, thanks!

@0xbyt4
Copy link
Collaborator

0xbyt4 commented Feb 6, 2026

Hi @andrewshab3 , Thanks for contribution ! Could you add unit tests for the new behavior

Done, thanks!

please fix error

@codecov
Copy link

codecov bot commented Feb 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Python code robotics Robotics code changes tests Test files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants