Skip to content

Conversation

@sirknightj
Copy link
Contributor

Issue #, if available:

  • N/A

What was changed?

  • Enhanced ParallelSimpleHttpClient with configurable shutdown timeout and proper exception handling
  • Added comprehensive test coverage for timeout scenarios in ParallelSimpleHttpClientShutdownTest
  • Add closeTimeout() builder method with default timeout
  • Implement proper executor shutdown with awaitTermination()
  • Replace printStackTrace() with structured logging
  • Added stream name to the logging
  • Make close operation idempotent
  • Propagate TimeoutException to completion callback on shutdown timeout
  • Add test coverage for timeout scenarios

Why was it changed?

  • The original close() method had several issues:
    • No timeout mechanism for executor shutdown
    • Swallowing exceptions: no way for callers to be notified of shutdown failures via completion callback
    • Missing null checks

How was it changed?

  • Enhanced shutdown logic: Implemented awaitTermination() with configurable timeout (default 5 seconds)
  • Added timeout configuration: New closeTimeout() builder method allows customization of shutdown timeout
  • Improved error handling: Replaced printStackTrace() with proper log4j logging and structured exception handling
  • Robust resource cleanup: Added null checks and proper cleanup sequencing for socket and streams
  • Exception propagation: Timeout failures now generate TimeoutException passed to completion callback

What testing was done for the changes?

  • Ran the newly added tests locally
  • Ran the DemoAppMain locally

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 70.73171% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.47%. Comparing base (8b00331) to head (9090151).

Files with missing lines Patch % Lines
...ws/kinesisvideo/http/ParallelSimpleHttpClient.java 70.73% 10 Missing and 2 partials ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop     #252      +/-   ##
=============================================
+ Coverage      49.27%   49.47%   +0.19%     
- Complexity       568      576       +8     
=============================================
  Files            106      106              
  Lines           4134     4166      +32     
  Branches         263      272       +9     
=============================================
+ Hits            2037     2061      +24     
- Misses          1949     1952       +3     
- Partials         148      153       +5     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants