You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Paused/resume device API calls can hang for long periods #3001
bugA problem with current functionality, as opposed to missing functionality (enhancement)frozen-due-to-ageIssues closed and untouched for a long time, together with being locked for discussion
I've had an issue reported (canton7/SyncTrayzor#252) where calls to /rest/system/resume and /rest/system/pause can sometimes hang (for more than 90 seconds, at which point I time out). It appears to happen unpredictably.
It appears that the device in question is never actually paused/resumed, although I'm not 100% sure of that.
I notice that PauseDevice and ResumeDevice both acquire a lock - maybe something's holding this for an extended period?
Tricky... we lost the "monitor" process (SyncTrayor) when that dies, so we won't be able to capture output even if we do get it to crash.
I can probably code up something to kill Syncthing if it does die, but I'm not sure how to kill it in such a way that it will produce the output you need, working within the constraints of the winapi. Any suggestions?
It prints the stacktraces to stderr/out so I think you can capture them just fine. The bigger problem is making it crash. I know it's sigstop on unix, no idea what it is in windows. Worst case we can add a crash/debug endpoint which returns the stacktraces as json or forces a panic.
Also, STTRACE=sync (I think) will log lock usage, there is also another var (check help) for defining a threshold what gets logged. Hard to find links on the phone.
Ok, I had several of those crashes (canton7/SyncTrayzor#252) appearing randomly. Usually after prolonged usage (i.e. running ST overnight).
Now, while the full blown crash is quite rare, the same error message appears in the logs far more frequently.
So the crash you posted now does not look related to the original crash, furthermore, I don't see any reasonable blocking from syncthing. The only lock I can see is on the GetIgnores() due to a scan currently running.
Barring deadlocks and stuff (which are bugs that we should fix), the calls blocking until the pause/resume action is taken is by design and not a bug. We may add things to or redesign the API, but this is not the ticket for it.
I think it doesn't as things still require holding pmut, which is what was blocking above. (I'm not convinced this is a problem necessarily, and we should slowly move away from those locks probably, but it's not my bug report.)
I haven't witnessed those crashes for quite a long while. And unfortunately I never got a clear way/steps of reproducing it, it always was kinda random.
I had few crashes a couple of weeks ago, but timing was bad and I couldn't play with it much, so it may be unrelated to this issue.
bugA problem with current functionality, as opposed to missing functionality (enhancement)frozen-due-to-ageIssues closed and untouched for a long time, together with being locked for discussion
Activity
AudriusButkevicius commentedon Apr 22, 2016
We need to make it crash somehow to figure out whats holding the lock. My money is on Windows firewall blocking socket writes indefinately.
canton7 commentedon Apr 22, 2016
Tricky... we lost the "monitor" process (SyncTrayor) when that dies, so we won't be able to capture output even if we do get it to crash.
I can probably code up something to kill Syncthing if it does die, but I'm not sure how to kill it in such a way that it will produce the output you need, working within the constraints of the winapi. Any suggestions?
AudriusButkevicius commentedon Apr 22, 2016
It prints the stacktraces to stderr/out so I think you can capture them just fine. The bigger problem is making it crash. I know it's sigstop on unix, no idea what it is in windows. Worst case we can add a crash/debug endpoint which returns the stacktraces as json or forces a panic.
canton7 commentedon Apr 22, 2016
Hmm, I can't seem to find anything helpful online.
AudriusButkevicius commentedon Apr 22, 2016
See http://stackoverflow.com/a/19145992/1508606 and STPROFILER
canton7 commentedon Apr 22, 2016
Perfect, thanks 👍
AudriusButkevicius commentedon Apr 22, 2016
Also, STTRACE=sync (I think) will log lock usage, there is also another var (check help) for defining a threshold what gets logged. Hard to find links on the phone.
scienmind commentedon May 1, 2016
Ok, I had several of those crashes (canton7/SyncTrayzor#252) appearing randomly. Usually after prolonged usage (i.e. running ST overnight).
Now, while the full blown crash is quite rare, the same error message appears in the logs far more frequently.
So, here's SyncTrayzor log with the error, appearing after "wake from sleep":
https://gist.github.com/anonymous/a2baa96d5f17b65c269f36316493b6ed
And, as per canton7's request, I've set
STPROFILER=localhost:8385, and here's the output ofhttp://localhost:8385/debug/pprof/goroutine?debug=2:https://gist.github.com/anonymous/973b8cbf5cfb9f3cad63daa184403b1a
AudriusButkevicius commentedon May 1, 2016
So the crash you posted now does not look related to the original crash, furthermore, I don't see any reasonable blocking from syncthing. The only lock I can see is on the GetIgnores() due to a scan currently running.
scienmind commentedon May 1, 2016
OK, I'll post again the "actual" crash then, once I'll catch it
canton7 commentedon May 1, 2016
That SyncTrayzor log doesn't show a crash, no.
scienmind commentedon May 11, 2016
I have had SyncTrayzor & Syncthing silently crashing during "wake from sleep", here are the logs:
SyncTrayzor: https://gist.github.com/anonymous/a52a5158bd4cca9145137fda6092dc2d
Syncthing: https://gist.github.com/anonymous/7134dbcbadf381ff1e83961fb7056c31
Unfortunately,
/debug/pprof/goroutine?debug=2can't be polled, since syncthing is dead...AudriusButkevicius commentedon May 11, 2016
This is on Synctrayzors plate, not syncthings.
canton7 commentedon May 11, 2016
Yes, this is a separate issue. Please open a new issue on SyncTrayzor's issue tracker.
10 remaining items
all: Add folder pause, make pauses optionally permanent (fixes syncth…
all: Add folder pause, make pauses optionally permanent (fixes syncth…
calmh commentedon Nov 23, 2016
Barring deadlocks and stuff (which are bugs that we should fix), the calls blocking until the pause/resume action is taken is by design and not a bug. We may add things to or redesign the API, but this is not the ticket for it.
all: Add folder pause, make pauses optionally permanent (fixes syncth…
all: Add folder pause, make pauses optionally permanent (fixes syncth…
all: Add folder pause, make pauses permanent (fixes #3407, fixes #215, …
calmh commentedon Dec 26, 2016
How was this addressed by this change?
AudriusButkevicius commentedon Dec 26, 2016
Device pauses are now handled in CommitConfig which I hope fixes this issue.
calmh commentedon Dec 28, 2016
I think it doesn't as things still require holding pmut, which is what was blocking above. (I'm not convinced this is a problem necessarily, and we should slowly move away from those locks probably, but it's not my bug report.)
AudriusButkevicius commentedon Dec 28, 2016
Well if OP can still repro we can reopen.
scienmind commentedon Dec 28, 2016
I haven't witnessed those crashes for quite a long while. And unfortunately I never got a clear way/steps of reproducing it, it always was kinda random.
I had few crashes a couple of weeks ago, but timing was bad and I couldn't play with it much, so it may be unrelated to this issue.
If it'll reappear, I will let you know.
AudriusButkevicius commentedon Dec 28, 2016
This shouldn't be a crash atleast from syncthing side.