Skip to content

lib/ur: Send unreported failures on shutdown - #7164

Merged
calmh merged 8 commits into
syncthing:mainfrom
imsodin:ur/failureStoring
Dec 22, 2020
Merged

calmh merged 8 commits into
syncthing:mainfrom
imsodin:ur/failureStoring

Conversation

@imsodin

@imsodin imsodin commented Nov 27, 2020

Copy link
Copy Markdown
Member

If a fatal error should be reported, chances are good we are getting shut down before they can be reported. To mitigate that unsent reports are written to disk when the service stops and these failures are then reported on next startup.

@calmh

calmh commented Nov 27, 2020

Copy link
Copy Markdown
Member

Is there reason to believe we have time to write them to disk? (And if there is, why don't we have time to send them upstream instead?)

@imsodin

imsodin commented Nov 27, 2020

Copy link
Copy Markdown
Member Author

Suture gives a service 10s to terminate, which is hopefully enough to write to disk. However shutdown should be as fast as possible, and given the pretty long timeouts we have on all these network sending tasks, I classified them as too slow to happen on shutdown. In normal circumstances that's probably not the case, and we could try to send for e.g. 100ms and only write to disk if that fails.

Comment thread lib/ur/failurereporting.go Outdated
}
return
}
if err := sendFailureReports(ctx, reports, url); err != nil {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

delete the file after it's sent, or it will get sent repeatedly?

@calmh

calmh commented Dec 6, 2020

Copy link
Copy Markdown
Member

I'm kinda sorta feeling this is too much machinery for quite little gain, but i'm not going to actively fight it.

@AudriusButkevicius

Copy link
Copy Markdown
Member

Has the failure stuff proven to be useful thus far?

@imsodin

imsodin commented Dec 9, 2020

Copy link
Copy Markdown
Member Author

It just feels wrong to not report most fatal errors by design.

However I agree storing stuff on disk is too much machinery for the gain. To still have some chance of getting reports sent on shutdown, it now tries to send reports on shutdown, with a timeout of half the service timeout (which is now accessible as svcutil.ServiceTimeout).

And for reasons I acted on util containing too much different stuff and move bits relevant to services to svcutil. While a trivial change, it blows up the diff drowning the relevant bits. Tell me if you think it would be better in a separate PR.

@imsodin imsodin changed the title lib/ur: Store unreported failures on shutdown lib/ur: Send unreported failures on shutdown Dec 9, 2020
imsodin added a commit to imsodin/syncthing that referenced this pull request Dec 10, 2020
calmh
calmh previously approved these changes Dec 21, 2020
@calmh

calmh commented Dec 21, 2020

Copy link
Copy Markdown
Member

Is fine, requires reviving... :/

calmh
calmh previously approved these changes Dec 21, 2020
@calmh
calmh merged commit a20a5f6 into syncthing:main Dec 22, 2020
@imsodin
imsodin deleted the ur/failureStoring branch December 22, 2020 21:31
calmh added a commit to calmh/syncthing that referenced this pull request Dec 26, 2020
* main:
  lib/model: Remove obsolete return val from ccHandleFolders (ref syncthing#6443) (syncthing#7229)
  gui, man, authors: Update docs, translations, and contributors
  gui: Fix missing sharing device when adding pending folder (syncthing#7227)
  cmd/stevents: Add command line argument for event type filtering. (syncthing#7226)
  lib/ur: Send unreported failures on shutdown (syncthing#7164)
  gui: Fix nonfunctional ignore button on pending folder notification (syncthing#7224)
@calmh calmh added this to the v1.13.0 milestone Jan 11, 2021
hiqua pushed a commit to hiqua/syncthing that referenced this pull request Jan 11, 2021
@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 Dec 23, 2021
@syncthing syncthing locked and limited conversation to collaborators Dec 23, 2021
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.

4 participants