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

Fix long timeout when loosing connection during app download #3236

Merged
merged 6 commits into from
May 26, 2023

Conversation

christoph-zededa
Copy link
Contributor

@christoph-zededa christoph-zededa commented May 23, 2023

If eve looses connection while downloading an app image, it
first has to timeout to retry downloading with another network
interface.
The reason is that the error from io.Copy (copying from the network
connection) is not propagating the error to the caller that decides
to cancel this connection and retry on a different interface.

This change propagates the error to the downloader goroutine and this
one then cancels the connection.

@deitch
Copy link
Contributor

deitch commented May 23, 2023

What is "eve 413 3"? And what is the description of the issue?

@christoph-zededa
Copy link
Contributor Author

What is "eve 413 3"? And what is the description of the issue?

it is still wip ;-)

@deitch
Copy link
Contributor

deitch commented May 23, 2023

Ah, just a placeholder for you to recall? Got it.

@christoph-zededa christoph-zededa changed the title Fix eve 413 3 WIP: Fix long timeout when loosing connection during app download May 23, 2023
pkg/pillar/go.mod Outdated Show resolved Hide resolved
@christoph-zededa christoph-zededa force-pushed the fix_eve-413-3 branch 3 times, most recently from 702d882 to 136ea75 Compare May 23, 2023 17:54
@christoph-zededa christoph-zededa force-pushed the fix_eve-413-3 branch 2 times, most recently from 2f96639 to 88efa73 Compare May 24, 2023 13:14
@christoph-zededa christoph-zededa changed the title WIP: Fix long timeout when loosing connection during app download Fix long timeout when loosing connection during app download May 24, 2023
var ok bool
for {
select {
case stats, ok = <-prgNotif:
case newStats, ok = <-prgNotif:
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you please add a comment why exactly we use a 'newStats' variable?
Actually this is a different bug fix (race fix) and ideally would be great a separate commit for that, but if you write an explicit comment and also mention the fix for the race in the commit message it seems would be sufficient.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

here it is: 3653d4c

@@ -262,20 +262,26 @@ func NewDronaCtx(name string, noHandlers int) (*DronaCtx, error) {
return &dSync, nil
}

func reqPostSize(req *DronaRequest, dronaCtx *DronaCtx, stats types.UpdateStats) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please don't commit the vendor changes. The hash should be updated.

Copy link
Contributor

Choose a reason for hiding this comment

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

@rouming Presumably need both the hash updated and the vendor directory updated based on the updated hash.

Copy link
Contributor

Choose a reason for hiding this comment

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

@eriknordmark yes, what I meant is better not to mix the actual changes with autogenerated changes, which at least should go in a separate commit. (with a lib hash update, for sure)

@christoph-zededa christoph-zededa force-pushed the fix_eve-413-3 branch 2 times, most recently from e939d8c to dfc452c Compare May 24, 2023 17:38
@christoph-zededa christoph-zededa marked this pull request as ready for review May 24, 2023 17:41
@christoph-zededa christoph-zededa requested a review from rvs as a code owner May 24, 2023 17:41
Copy link
Contributor

@eriknordmark eriknordmark left a comment

Choose a reason for hiding this comment

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

We do need to get the new hash for the libs and then the vendor directory updated; are you doing that in a separate PR?

Once @rouming has signed off, can you squash these commits?

rouming and others added 6 commits May 25, 2023 18:18
If eve looses connection while downloading an app image, it
first has to timeout to retry downloading with another network
interface.
The reason is that the error from io.Copy (copying from the network
connection) is not propagating the error to the caller that decides
to cancel this connection and retry on a different interface.

This change propagates the error to the downloader goroutine and this
one then cancels the connection.

Signed-off-by: Christoph Ostarek <christoph@zededa.com>
when the download is finished; this is needed to forward
the error if there is any and not to loose it

Signed-off-by: Christoph Ostarek <christoph@zededa.com>
to make it easier readable by clarifying which variables
this piece of code is dependent on; also it makes it easier
for the reader to skip uninteresting code.

Signed-off-by: Christoph Ostarek <christoph@zededa.com>
- use format string
- automatically use attempt variable from lambda capture

Signed-off-by: Christoph Ostarek <christoph@zededa.com>
Signed-off-by: Christoph Ostarek <christoph@zededa.com>
Just autogenerated stuff after the following commands:

make proto && make proto-vendor

Nothing to look at.

Signed-off-by: Christoph Ostarek <christoph@zededa.com>
@christoph-zededa
Copy link
Contributor Author

I created two new commits:
a942da0
14ce7b2

to update go.{mod,sum} and vendor/proto.

Will squash those two before merge.

Copy link
Contributor

@eriknordmark eriknordmark left a comment

Choose a reason for hiding this comment

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

Run eden

@eriknordmark eriknordmark merged commit c6c54b4 into lf-edge:master May 26, 2023
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