BUG: Preserve execution warnings when a filter is cancelled
メンテナーはふだん 6 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
src/simplnx/Filter/IFilter.cpp、特に IFilter::execute のキャンセル分岐と、test/FilterTest.cpp にある既存のフィクスチャを確認してください。説明されている preflight と実行時の警告を使った回帰テストを追加し、実行エラーを保持しながら、キャンセル結果に両方の警告リストと preflight の出力値が残るように更新してください。simplnx_test をビルドし、指定された CTest ケースを実行してください。キャンセルエラーと両方の警告が存在すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Problem
When a filter requests cancellation during execution and returns a valid result with a warning, IFilter::execute reports cancellation and loses the execution warning. The result should contain the cancellation error and warnings from both preflight and execution.
This occurred in a Windows MSVC Release test linked against simplnx 44875faf4e349cf2004fc69fcef3ab1f308aa995. The affected IFilter.cpp is identical at the develop base 8cad1e818a6517eb933a85d1654bb4415a6396d6.
Steps to Reproduce
- Use a filter that returns one warning from preflight and a different warning from execution.
- Have the filter set the caller's cancellation flag immediately before it returns the valid execution result.
- Call the public
IFilter::executeentry point. It returns cancellation error-1and only the preflight warning.
Cause
The cancellation branch returns before the normal merge of the preflight and execution results. Its merge uses only the preflight result and the cancellation error. Cancellation branch in IFilter::execute
if(shouldCancel && executeImplResult.valid())
{
return ExecuteResult{MergeResults(std::move(preflightActionsResult), MakeErrorResult(-1, "Filter cancelled")), std::move(preflightResult.outputValues)};
}
Verification Unit Test
Add the following to test/FilterTest.cpp. It uses the existing BackstopFilterBase and k_PreflightWarningCode. Build simplnx_test, then run ctest -C Release -j 1 -R "^IFilter: Cancellation preserves execution warnings$" --output-on-failure --no-tests=error from the configured build directory.
namespace
{
class CancelAfterWarningFilter : public BackstopFilterBase<CancelAfterWarningFilter>
{
public:
static inline constexpr StringLiteral k_FilterName = "CancelAfterWarningFilter";
static inline constexpr StringLiteral k_FilterUuid = "784f2751-bc9d-4d53-b610-1d36e26bb5f4";
static inline constexpr int32 k_ExecutionWarningCode = -9980;
std::atomic_bool* cancelFlag = nullptr;
protected:
PreflightResult preflightImpl(const DataStructure&, const Arguments&, const MessageHandler&, const std::atomic_bool&, const ExecutionContext&) const override
{
Result<OutputActions> result;
result.warnings().push_back(Warning{k_PreflightWarningCode, "The controlled preflight warning"});
return {std::move(result)};
}
Result<> executeImpl(DataStructure&, const Arguments&, const PipelineFilter*, const MessageHandler&, const std::atomic_bool&, const ExecutionContext&) const override
{
cancelFlag->store(true);
return MakeWarningVoidResult(k_ExecutionWarningCode, "The controlled execution warning");
}
};
} // namespace
TEST_CASE("IFilter: Cancellation preserves execution warnings", "[simplnx][IFilter]")
{
std::atomic_bool shouldCancel = false;
CancelAfterWarningFilter filter;
filter.cancelFlag = &shouldCancel;
DataStructure dataStructure;
const Arguments args;
const auto execution = filter.execute(dataStructure, args, nullptr, {}, shouldCancel);
REQUIRE(shouldCancel.load());
REQUIRE(execution.result.invalid());
REQUIRE(execution.result.errors().front().code == -1);
const auto& warnings = execution.result.warnings();
REQUIRE_FALSE(warnings.empty());
CHECK(warnings.front().code == k_PreflightWarningCode);
REQUIRE(warnings.size() == 2);
CHECK(warnings[1].code == CancelAfterWarningFilter::k_ExecutionWarningCode);
}
The test was compiled with the existing Catch2 fixtures and run through CTest in an isolated test harness. The cancellation code and preflight warning checks passed. The warning count failed with 1 == 2. The existing test that checks execution-error precedence over cancellation passed in the same harness.
Proposed Fix
In IFilter::execute, combine the preflight and execution results before adding the cancellation error. Preserve both warning lists and the preflight output values. If execution already returned an error, keep that error as the reported failure.
Notes
This is the shared wrapper follow-up identified in the simplnx #1888 review. It applies to any filter that returns warnings when cancellation is set during execution.
- 主要言語
- C++
- スター
- 18
- フォーク
- 15
- 平均マージ
- 4日 23時間
- マージ済み PR(30日)
- 42
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
BlueQuartzSoftware/simplnx のほかの issue
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
BlueQuartzSoftware/simplnx#1980 ·
メンテナーはふだん 6 日以内に返信
-
Testing
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
BlueQuartzSoftware/simplnx#1979 ·
メンテナーはふだん 6 日以内に返信
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
BlueQuartzSoftware/simplnx#1978 ·
メンテナーはふだん 6 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
BlueQuartzSoftware/simplnx#1945 ·
メンテナーはふだん 6 日以内に返信
-
BUG: Preserve precision in StringParameter legacy numeric conversion対応中かも @jmarquisbq が 8 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
BlueQuartzSoftware/simplnx#1944 · 担当者 1 名 ·
メンテナーはふだん 6 日以内に返信
BlueQuartzSoftware/simplnx の issue をすべて見る
似ている issue
-
agent:Windows bug parity performance pri:medium sev:low tooling windows
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
ai_p2
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
ClickHouse/ClickHouse#132519 ·
メンテナーはふだん 1 日以内に返信
-
patch_advisor_json_integration fails when the build tree is reached through a symbolic link対応中かも @DerKarussellbremser が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
boykopovar/AnyPS5#22581 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
[Bug]: VST3 getMidiControllerAssignment reads past midiControllerToParameter for program changeオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
juce-framework/JUCE#1810 ·