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

リトライ処理の改善 #192

Merged
merged 22 commits into from
Dec 3, 2024
Merged

リトライ処理の改善 #192

merged 22 commits into from
Dec 3, 2024

Conversation

Hexa
Copy link
Contributor

@Hexa Hexa commented Nov 26, 2024

This pull request includes several changes to improve the handling of audio streaming and error management in the amazon_transcribe, handler, amazon_transcribe_handler, packet_dump_handler, and speech_to_text_handler files. The most important changes include adding a new logging library, updating function parameters, improving error handling, and modifying the retry logic.

Logging Improvements:

  • Added zerolog for improved logging capabilities in amazon_transcribe.go.

Function Parameter Updates:

  • Changed the Start method in amazon_transcribe.go to use io.ReadCloser instead of io.Reader.
  • Updated the Handle method in amazon_transcribe_handler.go, packet_dump_handler.go, and speech_to_text_handler.go to accept chan opusChannel instead of io.Reader. [1] [2] [3]

Error Handling Enhancements:

  • Improved error handling in the Start method by adding a log statement for errors in amazon_transcribe.go.
  • Enhanced error handling logic in handler.go to manage server disconnections and retries more effectively. [1] [2]

Retry Logic Modifications:

  • Modified the retry logic in handler.go to use a timer and handle retries more gracefully.
  • Reset retry count upon successful request in amazon_transcribe_handler.go and speech_to_text_handler.go. [1] [2]

Test Updates:

  • Adjusted test durations and assertions in handler_test.go to match the updated logic. [1] [2] [3] [4] [5] [6]

下記の 3 点を改善しています

  • リトライカウントをリセットするタイミングを、サービスへの接続が成功した時点に変更

    • リトライカウントがリセットされない不具合の修正
  • サービスへのパケット送信でエラーが生じた場合、io エラーとして扱い、解析結果の送信処理と分けるように変更

    • エラーメッセージの送信時にリトライカウントをリセットする不具合の修正
  • クライアントからの opus パケットの受信処理と、ogg への換処理を分離

    • リトライ処理中はクライアントからの切断処理がブロックされる状態の修正

@Hexa Hexa marked this pull request as ready for review November 29, 2024 08:20
@Hexa Hexa requested a review from voluntas December 2, 2024 07:29
handler.go Outdated Show resolved Hide resolved
handler.go Outdated Show resolved Hide resolved
handler.go Outdated Show resolved Hide resolved
@Hexa Hexa merged commit e7fb3ba into develop Dec 3, 2024
1 check passed
@Hexa Hexa deleted the feature/fix-retry-processing branch December 3, 2024 03:34
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.

2 participants