Skip to content

lib/model: Simplify pull error/retry logic (fixes #6139) - #6141

Merged
calmh merged 2 commits into
syncthing:masterfrom
imsodin:model/pullErrSimplified
Nov 11, 2019
Merged

calmh merged 2 commits into
syncthing:masterfrom
imsodin:model/pullErrSimplified

Conversation

@imsodin

@imsodin imsodin commented Nov 8, 2019

Copy link
Copy Markdown
Member

Change counter zero does not mean there weren't any errors -> resetting all errors is incorrect. So instead of the global error reset on "success" errors are now reset every iteration (this makes sure we catch transient errors, which we didn't before). I.e. no more error resetting for individual items (which is anyway pretty fragile as it's easy to forget it). Same for incrementing changed: It's now done globally in the beginning instead of in various places, and decremented in the one place we don't do anything ever and thus don't want to retry (windows invalid filenames).

@calmh

calmh commented Nov 9, 2019

Copy link
Copy Markdown
Member

LGTM apart from breaking tests, which could be the tests being wrong but requires investigation.

@imsodin

imsodin commented Nov 9, 2019

Copy link
Copy Markdown
Member Author

I believe it's just flakyness (Mac and win pass) - I'll have a closer look when back at a computer (Sunday or Monday).

@calmh

calmh commented Nov 9, 2019

Copy link
Copy Markdown
Member

👍

CopierFinder failure looks systematic even on reruns, and isn't one that is known to be flaky previously I think.

@imsodin

imsodin commented Nov 11, 2019

Copy link
Copy Markdown
Member Author

I wanted to have the fast failure from master and after merging that it now did pass. And I can't reproduce on my pc. I don't understand how those failures can happen: The two functions that failed (TestWeakHash and TestCopierFinder) both should receive something on the pull chan but time out waiting for that. The common pattern is

go f.copierRoutine(..., pullChan, ...)
f.handleFile
<-pullChan

That points at a race between copierRoutine "starting up" and handleFile passing the file to it. However handleFile just sends it on the copier chan waiting for it to be read, it doesn't care if copierRoutine isn't ready yet.

@calmh
calmh merged commit ce72bee into syncthing:master Nov 11, 2019
@imsodin
imsodin deleted the model/pullErrSimplified branch November 11, 2019 14:56
calmh added a commit to calmh/syncthing that referenced this pull request Nov 17, 2019
* master:
  golang-ci: Skip "cognitive complexity" check for now
  lib/model: Prevent cleanup-race in testing (ref syncthing#6152) (syncthing#6155)
  gui: Decrease padding on the panel and modal bodies (syncthing#6153)
  lib/model: In tests prevent goroutine leaks and increase timeouts (syncthing#6152)
  lib/model: Simplify pull error/retry logic (fixes syncthing#6139) (syncthing#6141)
calmh added a commit to calmh/syncthing that referenced this pull request Nov 17, 2019
* master:
  golang-ci: Skip "cognitive complexity" check for now
  lib/model: Prevent cleanup-race in testing (ref syncthing#6152) (syncthing#6155)
  gui: Decrease padding on the panel and modal bodies (syncthing#6153)
  lib/model: In tests prevent goroutine leaks and increase timeouts (syncthing#6152)
  lib/model: Simplify pull error/retry logic (fixes syncthing#6139) (syncthing#6141)
  docker: Add stdiscosrv and strelaysrv Dockerfiles (syncthing#6143)
  lib/protocol: Buffer allocation when compressing (fixes syncthing#6146) (syncthing#6147)
  golang-ci: Upgrade, skipping the white space complainer
  all: Cleanups enabled by Go 1.12
  lib/tlsutil: Remove Go 1.12 TLS 1.3 beta opt-in
  lib/api: Make theme paths relative (syncthing#6142)
  gui, lib/api: Adds support for prefers-color-scheme (fixes syncthing#6115)
  lib/api: Reset mtime after theme change (fixes syncthing#5810) (syncthing#6140)
  lib/model: Remove some testing deadlocks (syncthing#6138)
  lib/model: Add test for previous commit
  lib/model: Add initial deviceStatRefs on model creation (fixes syncthing#6136) (syncthing#6137)
  lib/model: Add folders on start in model (syncthing#6135)
@calmh calmh added this to the v1.3.3 milestone Nov 21, 2019
calmh added a commit to calmh/syncthing that referenced this pull request Nov 24, 2019
…nto logsuppression

* 'logsuppression' of https://github.com/calmh/syncthing:
  wip
  golang-ci: Skip "cognitive complexity" check for now
  lib/model: Prevent cleanup-race in testing (ref syncthing#6152) (syncthing#6155)
  gui: Decrease padding on the panel and modal bodies (syncthing#6153)
  lib/model: In tests prevent goroutine leaks and increase timeouts (syncthing#6152)
  lib/model: Simplify pull error/retry logic (fixes syncthing#6139) (syncthing#6141)
  docker: Add stdiscosrv and strelaysrv Dockerfiles (syncthing#6143)
  lib/protocol: Buffer allocation when compressing (fixes syncthing#6146) (syncthing#6147)
  golang-ci: Upgrade, skipping the white space complainer
  all: Cleanups enabled by Go 1.12
  lib/tlsutil: Remove Go 1.12 TLS 1.3 beta opt-in
  lib/api: Make theme paths relative (syncthing#6142)
  gui, lib/api: Adds support for prefers-color-scheme (fixes syncthing#6115)
  lib/api: Reset mtime after theme change (fixes syncthing#5810) (syncthing#6140)
  lib/model: Remove some testing deadlocks (syncthing#6138)
  lib/model: Add test for previous commit
  lib/model: Add initial deviceStatRefs on model creation (fixes syncthing#6136) (syncthing#6137)
  lib/model: Add folders on start in model (syncthing#6135)
@st-review st-review added the frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion label Nov 11, 2020
@syncthing syncthing locked and limited conversation to collaborators Nov 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants