Skip to content

fix: PROSPER connector doesn't recover from failure after network issue#328

Open
mohammad-arif662 wants to merge 4 commits intomainfrom
POFSP-1506
Open

fix: PROSPER connector doesn't recover from failure after network issue#328
mohammad-arif662 wants to merge 4 commits intomainfrom
POFSP-1506

Conversation

@mohammad-arif662
Copy link
Contributor

@mohammad-arif662 mohammad-arif662 commented Feb 5, 2026

Problem

When a simulation was running and the system lost internet connectivity, the connector would terminate unexpectedly, leaving the run stuck in "running" status indefinitely. It happens because PublishConnectorStatus was declared as async void, which cannot be awaited by the caller and causes unhandled exception type HttpRequestException to crash the process.

Fix

Changed PublishConnectorStatus from async void to async Task and added proper await calls. Now network exceptions propagate to the outer try/catch block which allows the connector to continue running and recover when connectivity is restored and marks the run as "failure".

@mohammad-arif662 mohammad-arif662 changed the title replace async void with async Task in PublishConnectorStatus fix: PROSPER connector doesn't recover from failure after network issue Feb 5, 2026
@codecov
Copy link

codecov bot commented Feb 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.09%. Comparing base (74fb523) to head (c798d77).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #328      +/-   ##
==========================================
+ Coverage   75.48%   76.09%   +0.61%     
==========================================
  Files          38       38              
  Lines        4083     4083              
  Branches      487      488       +1     
==========================================
+ Hits         3082     3107      +25     
+ Misses        817      792      -25     
  Partials      184      184              
Files with missing lines Coverage Δ
Cognite.Simulator.Utils/SimulationRunnerBase.cs 75.69% <100.00%> (+3.12%) ⬆️

... and 4 files with indirect coverage changes

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

@abdullah-cognite
Copy link
Collaborator

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly addresses a potential stability issue by changing the PublishConnectorStatus method from async void to async Task. This prevents unhandled exceptions from crashing the application and allows for proper error propagation. My review includes a few suggestions to align the naming of this asynchronous method with the project's style guide by adding the Async suffix. Overall, this is a solid and important fix.

@mohammad-arif662 mohammad-arif662 marked this pull request as ready for review February 5, 2026 09:11
@mohammad-arif662 mohammad-arif662 requested a review from a team as a code owner February 5, 2026 09:11
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