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

server: Discovery store is only persisted on clean shutdown

オープン 初心者向け
#663 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

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

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
76/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
backend, databases

調査の方向性

server/app/services/run_discovery.py と DiscoveryStore.to_file() の実装を読み、その後 post_all_asset_links_by_id と delete_all_asset_links_by_id を調べて、インメモリストアをどのように更新するか確認してください。永続モードで storage_path がどのように設定されるかを確認してください。サービスが正常に停止しなかった後も、成功した POST または DELETE の結果が利用可能であれば完了です。書き込み時の永続化を選ばない場合は、README のドキュメントのみの選択肢が代替案になります。

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

説明

bug server

The discovery service writes its store to storage_path only in an
atexit hook:

https://github.com/eclipse-basyx/basyx-python-sdk/blob/2773ac069d3163cbbd32c3c634813d38bbe521ad/server/app/services/run_discovery.py#L38-L43

The write handlers post_all_asset_links_by_id and
delete_all_asset_links_by_id only change the in-memory dicts.

The discovery_standalone README describes a "Persistent Mode" but
does not say that changes are written only at shutdown:

https://github.com/eclipse-basyx/basyx-python-sdk/blob/2773ac069d3163cbbd32c3c634813d38bbe521ad/server/example_configurations/discovery_standalone/README.md#L31-L43

Expected behavior: In persistent mode, a successful POST or DELETE
on /lookup/shells/{aasIdentifier} survives a crash of the service.

Actual behavior: Changes reach the disk only on a clean shutdown.
If the process is killed (OOM, docker kill, host crash, uWSGI worker
crash), all asset links registered since startup are lost.

Environment: develop @ 2773ac06, image built from
server/docker/discovery/Dockerfile with storage_path set.

Options:

  1. Persist on every write: call DiscoveryStore.to_file() at the end
    of both write handlers and drop the atexit hook. to_file()
    already writes a temp file and uses os.replace(), so the write is
    atomic.
  2. Keep the current behavior and document it: state in the README
    that changes are saved only on a clean shutdown and that a crash
    loses everything since the last start.

Option 1 is a small change and makes "persistent mode" mean what users
expect, so I would prefer it.

主要言語
Python
スター
106
フォーク
59
平均マージ
4日 1時間
マージ済み PR(30日)
3

環境構築

はじめの一歩

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

eclipse-basyx/basyx-python-sdk のほかの issue

eclipse-basyx/basyx-python-sdk の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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