Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Listener to services should be on a separate thread and resilient by default

オープン
#682 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 6 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
django, kafka, kubernetes, python

調査の方向性

生成された Django アプリケーションの起動パスと、issue で言及されている auth-service および event-listener の初期化から始めます。個別の pod/container アプローチと、レジリエントなバックグラウンド初期化を比較し、そのうえで、Kafka やアカウントが完全に利用可能でなくてもユーザー向けアプリケーションが起動すること、および初期化に失敗した場合にクラッシュループを発生させずに再試行されることを確認します。

索引モデルが issue の本文から書いたものです。

説明

scope:python-runtime

Generated applications for django have a default behaviour to sync users which requires kafka and accounts to be fully operative at startup. If they're not fully operative, pods go on a crashloop.
This is not ideal because the user facing part of the application does not necessarily requires user login functionality.

Ideally we should set this kind of listeners on a separate pod/container.

A quicker proposal is the following:

if os.environ.get('KUBERNETES_SERVICE_HOST', None):
    # init the auth service when running in/for k8s
    import threading 
    from cloudharness_django.services import get_auth_service, init_services
    from cloudharness import log
    import time
    def start_auth_service():
        try:
            init_services()
        except:
            log.exception("Error initializing services. Retrying in 5 seconds...")
            time.sleep(5)
            start_auth_service()

    threading.Thread(target=start_auth_service).start()
    # start the kafka event listener when running in/for k8s
    def start_event_listener():
        try:
            import cloudharness_django.services.events
            log.info("User sync events listener started")
        except:
            log.exception("Error initializing event queue. Retrying in 5 seconds...")
            time.sleep(5)
            start_event_listener()
    threading.Thread(target=start_event_listener).start()
主要言語
Python
スター
19
フォーク
5
平均マージ
5日 19時間
マージ済み PR(30日)
4

環境構築

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

MetaCell/cloud-harness のほかの issue

MetaCell/cloud-harness の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。