Skip to content

Conversation

calmh
Copy link
Member

@calmh calmh commented Jan 16, 2023

This makes sure the service manager doesn't interpret timeout errors, or any other error, as a signal to stop the service instead of restarting it.

I added it directly to our service utility function, as it may help catch other instances of the same problem... We would typically want timeouts etc to be a retryable error, unless it is the top level context that has timed out and we check for that specifically.

Copy link
Member

@imsodin imsodin left a comment

Choose a reason for hiding this comment

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

Seems like a reasonable workaround - I think in principle suture should get an update for this. I can't see this behaviour ever being desirable, and it's a change to previous versions. Or maybe it even was a blunder on Go's side - seems weird/unexpected that a context specific error is treated as a generic error fulfilled by any amount of other errors.

@calmh
Copy link
Member Author

calmh commented Jan 19, 2023

Yeah... My feeling is that if I have a context ctx and run a function fn() error, then I should probably not use the returned error to determine whether to stop the service (unless it is the special suture.NoNotRestart or whatever it's called), as there is nothing to say the returned error is specifically related to my context, it might be a child context that has timed out etc.

@calmh calmh merged commit abdac2c into syncthing:main Jan 19, 2023
calmh added a commit to calmh/syncthing that referenced this pull request Jan 23, 2023
* main: (69 commits)
  Handle relay connect timeout (fixes syncthing#8749) (syncthing#8755)
  gui, man, authors: Update docs, translations, and contributors
  build: Go 1.19.5
  gui, man, authors: Update docs, translations, and contributors
  script: Add weblatedl.go for downloading updated translations (syncthing#8723)
  gui: Allow to translate action and type in Recent Changes modal (syncthing#8548)
  gui, man, authors: Update docs, translations, and contributors
  gui: Fix undefined lastSeenDays error in disconnected-inactive status check (ref syncthing#8530) (syncthing#8730)
  gui, man, authors: Update docs, translations, and contributors
  gui, api: Indicate running under container (syncthing#8728)
  lib/fs: Use io/fs errors as recommended in std lib (syncthing#8726)
  build: Handle co-authors (ref syncthing#3744) (syncthing#8708)
  lib/fs: Watching is unsupported on android/amd64 (fixes syncthing#8709) (syncthing#8710)
  lib/model: Only log at info level if setting change time fails (syncthing#8725)
  lib/model: Don't lower rescan interval from default on auto accepted enc folder (fixes syncthing#8572) (syncthing#8573)
  gui, man, authors: Update docs, translations, and contributors
  gui: Remove unmaintained language variant nl-BE (syncthing#8722)
  gui, script: Fix indentation in lang-en.json to match others (syncthing#8721)
  docker: Ensure entrypoint is executable (syncthing#8719)
  Go 1.19.4
  ...
@calmh calmh added this to the v1.23.2 milestone Feb 12, 2023
calmh added a commit to calmh/syncthing that referenced this pull request Feb 22, 2023
* main: (48 commits)
  build: Use Go 1.19.6 for Windows
  build: Update dependencies
  gui, man, authors: Update docs, translations, and contributors
  gui: Remove duplicate Spanish (Spain) translation (fixes syncthing#8781) (syncthing#8782)
  gui: Add xattr filter editor (fixes syncthing#8660) (syncthing#8734)
  gui: Switch to Weblate for translations (syncthing#8777)
  all: Use new Go 1.19 atomic types (syncthing#8772)
  gui, man, authors: Update docs, translations, and contributors
  build: Update quic-go and pfilter for Go 1.20 (fixes syncthing#8768) (syncthing#8769)
  Add forgotten copyright notices
  cmd, docker: Updates for infrastructure
  cmd/ursrv: The driver import is important, though
  cmd/ursrv: Remove old, unused migration code
  cmd/ursrv: Harmonize timespan of charts
  cmd/ursrv: Remove broken and unsustainable join/leave chart
  cmd/ursrv: Fix broken block transfer chart
  gui, man, authors: Update docs, translations, and contributors
  gui: Fix broken link to Transifex in lang/README.txt (syncthing#8761)
  gui, man, authors: Update docs, translations, and contributors
  Handle relay connect timeout (fixes syncthing#8749) (syncthing#8755)
  ...
@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 Jan 19, 2024
@syncthing syncthing locked and limited conversation to collaborators Jan 19, 2024
@calmh calmh deleted the relaytimeout branch May 26, 2025 13:42
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