Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop streaming flag after cancelling all transfers #773

Closed
wants to merge 1 commit into from

Conversation

ggatis
Copy link
Contributor

@ggatis ggatis commented Aug 7, 2020

Otherwise transfer_tread_started is false, but streaming is still true. No big deal of course.

┆Issue is synchronized with this Basecamp todo by Unito

Otherwise transfer_tread_started is false, but streaming is still true. No big deal of course.
@mossmann mossmann requested a review from miek June 13, 2021 18:03
@straithe straithe added the enhancement potential new feature label Nov 4, 2021
@straithe straithe requested review from martinling and removed request for miek November 12, 2021 18:34
@martinling
Copy link
Member

Hi @ggatis, I'm sorry this has PR sat around for a while without much response.

It's obviously a very simple change, but it's been looked at a couple of times without it being immediately obvious if it's correct, so it's sat in the list for a while.

Do you happen to remember why you made this change? Was there a problem you were seeing that it fixed?

We do see a scenario in which the streaming flag may not get cleared, if a program that starts streaming using hackrf_start_rx or hackrf_start_tx, goes straight to calling hackrf_close without first calling hackrf_stop_{rx|tx}. Was that part of the scenario that led you to make this change? It would be nice to have a test case so that we can reproduce the problem and understand the fix better.

We were thinking that it might make more sense to clear the streaming flag in hackrf_close, rather than in cancel_transfers, but I'm not sure if there's a particular reason you put it there.

@martinling
Copy link
Member

I've now incorporated this change in #1069.

@martinling martinling closed this Mar 18, 2022
@ggatis
Copy link
Contributor Author

ggatis commented Mar 18, 2022 via email

@martinling
Copy link
Member

Hi @ggatis, thanks for confirming.

I was pretty sure your fix was correct, but I'd been a bit unclear on exactly what that flag was supposed to mean, and when and where it should be cleared.

Eventually some other bugs showed up where streaming wasn't being cleared (#1056 and #1068), so I went through all the usage in detail in PR #1069.

Once I'd done that and simplified the result, it turns out the streaming flag needs to be cleared in only two places: one of them being cancel_transfers, just as you suggested. So this PR was very helpful in getting to that point, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement potential new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants