Skip to content

Better handling stop datafeed#839

Merged
Yannick-Malins merged 3 commits intofinos:mainfrom
symphony-enrico:improve-datafeed-stop
Oct 20, 2025
Merged

Better handling stop datafeed#839
Yannick-Malins merged 3 commits intofinos:mainfrom
symphony-enrico:improve-datafeed-stop

Conversation

@symphony-enrico
Copy link
Copy Markdown
Contributor

@symphony-enrico symphony-enrico commented Oct 17, 2025

Sometime datafeed is not stopped after calling stop().

I identified one specific case:

  • the stop command is sent while datafeed is still initializing (it can take time!), then the stop flag was overwritten by pending start process and it will never stop

This PR solve this specific case

Sometime datafeed is not stopped after calling stop().
I identified a specific case, where the stop command is send while datafeed is still initilizing (and it can take time), as the stop flag was overwritten by pending start process
@Override
public void start() throws AuthUnauthorizedException, ApiException {
if (this.started.get()) {
if (!this.started.compareAndSet(false, true)) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Datafeed start flag must be check and set with an atomic operation as very first command of start/stop APIs (or both API must be synchronized, but I preferred to avoid this, also for using VirtualThread on client side for registering listeners).
Otherwise, during the start command, started flag was set only inside runLoop method, but I take some time to arrive on it (before, there is datafeed initialization) and we can have concurrency issue stopping it

@Yannick-Malins Yannick-Malins merged commit 4cab9ae into finos:main Oct 20, 2025
5 of 7 checks passed
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.

4 participants