Commit Graph

4493 Commits

Author SHA1 Message Date
Audrius Butkevicius
075a699aae lib/connections: Trust the model to tell us if we are connected
This should address issue as described in https://forum.syncthing.net/t/stun-nig-party-with-paused-devices/10942/13
Essentially the model and the connection service goes out of sync in terms of thinking if we are connected or not.
Resort to model as being the ultimate source of truth.

I can't immediately pin down how this happens, yet some ideas.

ConfigSaved happens in separate routine, so it's possbile that we have some sort of device removed yet connection comes in parallel kind of thing.
However, in this case the connection exists in the model, and does not exist in the connection service and the only way for the connection to be removed
in the connection service is device removal from the config.

Given the subject, this might also be related to the device being paused.

Also, adds more info to the logs

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4533
2017-11-21 08:32:23 +01:00
Jakob Borg
0a50f374db build: More signatures, more better (ref #3420) 2017-11-20 17:44:42 +01:00
Jakob Borg
4949721c0b lib/model: Trigger a pull when ignore patterns change
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4532
2017-11-20 17:32:51 +01:00
Jakob Borg
00ce889a8b build: Windows code signing (ref #3420) 2017-11-20 11:52:11 +01:00
Jakob Borg
3312a29dde lib/connections: Fix race condition in parallel dial, minor cleanups (fixes #4526) 2017-11-19 19:34:43 +01:00
Audrius Butkevicius
0518a92cdb lib/connections: Only announce punchable nats (fixes #4519)
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4523
2017-11-17 14:46:45 +00:00
Simon Frei
6cf01c1d30 lib/model: Don't update ignore hash when pull fails
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4522
2017-11-17 12:42:41 +00:00
Jakob Borg
5f4ed66aa1 lib/model: Properly schedule pull on reconnect (fixes #4504)
We need to reset prevSeq so that we force a full check when someone
reconnects - the sequence number may not have changed due to the
reconnect. (This is a regression; we did this before f6ea2a7.)

Also add an optimization: we schedule a pull after scanning, but there
is no need to do so if no changes were detected. This matters now
because the scheduled pull actually traverses the database which is
expensive.

This, however, makes the pull not happen on initial scan if there were
no changes during the initial scan. Compensate by always scheduling a
pull after initial scan in the rwfolder itself.

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4508
LGTM: imsodin, AudriusButkevicius
2017-11-17 12:11:45 +00:00
Jakob Borg
ee5d0dd43f lib/fs: Add case insensitivity to MtimeFS
This is step one of a hundred fifty on the path to case insensitivity.
It brings in the basic case folding mechanism and adds it to the
mtimefs, as this is something outside the fileset that touches stuff in
the database based on name. No effort to convert or handle existing
entries when the insensitivity is changed, I don't think we need it...

Useless by itself but includes tests and will reduce the review load
along the way.

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4521
2017-11-17 12:10:16 +00:00
Jakob Borg
7ebf58f1bc Fix discovery in the absence of listen addresses (fixes #4418)
This makes it OK to not have any listeners working. Specifically,

- We don't complain about an empty listener address
- We don't complain about not having anything to announce to global
  discovery servers
- We don't send local discovery packets when there is nothing to
  announce.

The last point also fixes a thing where the list of addresses for local
discovery was set at startup time and never refreshed.

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4517
2017-11-17 09:12:35 +00:00
AudriusButkevicius
aecd7c64ce lib/connections: Parallel dials in the same priority (fixes #4456)
Well Tested(TM)

Introduces a potential issue where we always pick some connectable but dodgy connection that breaks
soon after the TLS handshake.

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4489
2017-11-15 09:36:33 +00:00
Jakob Borg
783dd612f7 gui, man: Update docs & translations 2017-11-15 07:45:19 +01:00
Simon Frei
4efff736b3 lib/connections: Consistent log levels & polish (fixes #4510)
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4511
2017-11-14 21:49:36 +00:00
Simon Frei
fa12a18190 lib/model: Handle type changes when pulling (ref #4505 #4506 #4507)
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4509
LGTM: AudriusButkevicius, calmh
2017-11-13 15:16:27 +00:00
Jakob Borg
2b65e1062e lib/model: Fix rescan detection (fixes #4505, fixes #4506)
Diff is large due to comment reformatting and indentation but all it
does is wrap the file mtime/size/permissions check in an "if
stat.IsRegular()".

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4507
2017-11-13 06:57:07 +00:00
Jakob Borg
80031c59da test: Clean & unflake cli & conflict tests 2017-11-13 01:06:16 +01:00
Jakob Borg
6e35592e9e test: Clean & unflake HTTP / filetype tests 2017-11-13 01:00:49 +01:00
Jakob Borg
9e11d7b201 test: Clean and unflake ignore / manupeers / reconnect / override tests 2017-11-13 01:00:36 +01:00
Jakob Borg
fd5f9f8968 test: Fix reconnect test 2017-11-13 00:36:37 +01:00
Jakob Borg
d8a0a477ca test: Unflake symlink/scan tests 2017-11-13 00:25:07 +01:00
Jakob Borg
6dd6ecde95 test: Clean up and unflake sync cluster test 2017-11-13 00:25:07 +01:00
Jakob Borg
6e148e20cd test: Mend tests for latest event changes etc 2017-11-13 00:25:07 +01:00
Jakob Borg
72c5f2e5c6 test: Updates for fs/osutil package changes 2017-11-13 00:25:07 +01:00
Jakob Borg
d7d45d8092 lib/db: Refactor away the large genericReplace thing
This removes a significant, complex chunk of database code. The
"replace" operation walked both the old and new in lockstep and made the
relevant changes to make the new situation correct. But since delta
indexes we pretty much never need this - we just used replace to drop
the existing data and start over.

This makes that explicit and removes the complexity.

(This is one of those things that would be annoying to make case
insensitive, while the actual "drop and then insert" that we do is
easier.)

This is fairly well unit tested...

The one change to the tests is to cover the fact that previously replace
with something identical didn't bump the sequence number, while
obviously removing everything and re-inserting does. This is not
behavior we depend on anywhere.

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4500
LGTM: imsodin, AudriusButkevicius
2017-11-12 20:20:34 +00:00
Jakob Borg
57d5dfa80c jenkins: No jenkins 2017-11-11 23:49:37 +01:00
Simon Frei
c080f677cb all: Add invalid/ignored files to global list, announce to peers (fixes #623)
This lets us determine accurate completion status for remote peers when they
have ignored files.

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4460
2017-11-11 19:18:17 +00:00
Simon Frei
ec4c3bae0d lib/watchaggregator: Don't care about timings during testing on darwin
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4502
2017-11-10 17:05:31 +00:00
Audrius Butkevicius
386cb274bd lib/model: Incremental block stats usage reporting
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4498
LGTM: calmh
2017-11-09 21:16:29 +00:00
Jakob Borg
a9d422e008 Revert "lib/model: Use the new file name when requesting rescan"
This has consequences that I haven't thought through for case mismatches
(i.e. we have foo.txt in the database and queue a rescan for FOO.txt).
2017-11-09 13:55:45 +01:00
Jakob Borg
75f64733f9 lib/model: Use the new file name when requesting rescan
If the file is not already in the database, the "curfile" will be empty
and the rescan request cover the entire folder.
2017-11-09 13:48:39 +01:00
Jakob Borg
40c952c0ae gui, man: Update docs & translations 2017-11-08 07:45:21 +01:00
AudriusButkevicius
0ee1146e1c lib/connections: Indicate stack in transport (fixes #4463)
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4486
2017-11-07 07:25:05 +00:00
AudriusButkevicius
88180904f2 cmd/syncthing: Don't cache stale options in main (fixes #4474)
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4491
LGTM: imsodin, calmh
2017-11-07 07:20:19 +00:00
Simon Frei
f6ea2a7f8e lib/model: Trigger pulls instead of pulling periodically
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4340
2017-11-07 06:59:35 +00:00
AudriusButkevicius
c5f90d64bc cmd/syncthing: Report if weak hash is enabled
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4490
2017-11-06 15:04:59 +00:00
Jakob Borg
941c9f1531 cmd/syncthing: Accept pre-hashed password in config POST (fixes #4458)
It must be a bcrypt hash.

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4466
2017-11-06 14:22:10 +00:00
AudriusButkevicius
62a4106a79 lib/connections: Fix lan detection (fixes #4421)
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4487
2017-11-06 14:05:29 +00:00
Jakob Borg
9c855ab22e lib/config, lib/model: Configurable folder marker name (fixes #1126)
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4483
2017-11-05 12:18:05 +00:00
Jakob Borg
166273b357 vendor: Patch github.com/ccding/go-stun for user-visible spelling error 2017-11-05 12:05:01 +01:00
Jakob Borg
d304498027 vendor: Update github.com/syndtr/goleveldb, minor bugfixes 2017-11-05 10:56:24 +01:00
HairyFotr
7cbd92e1b1 all: Fix comment typos
Skip-check: authors

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4481
2017-11-04 07:20:11 +00:00
nelsonkhan
9245d22f16 gui: Rename 'global changes' to 'recent changes' (fixes #4326)
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4479
2017-11-03 07:09:10 +00:00
Jakob Borg
3f85f719de authors: Add nelsonkhan 2017-11-03 08:00:14 +01:00
Jakob Borg
7ba05c18ee Merge branch 'release'
* release:
  cmd/syncthing: Fix incorrect shadowing preventing first startup (fixes #4471)
2017-11-02 07:48:50 +01:00
Jakob Borg
617bf173a4 gui, man: Update docs & translations 2017-11-01 07:45:19 +01:00
Jakob Borg
5f8c0ca932 cmd/syncthing: Fix incorrect shadowing preventing first startup (fixes #4471) 2017-10-28 21:15:32 +02:00
Jakob Borg
93a66deb7e cmd/syncthing: Fix incorrect shadowing preventing first startup (fixes #4471) 2017-10-28 21:14:37 +02:00
Jakob Borg
997bed569e Merge branch 'release'
* release:
  lib/model: Add initial noop watch cancel func (fixes #4464)
  vendor: Fix kcp deadlock
2017-10-28 10:04:28 +02:00
Simon Frei
b999b58049 lib/watchaggregator: Relax test timing requirement for the benefit of macos
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4469
2017-10-26 21:09:10 +00:00
Simon Frei
2953fe40d1 lib/model: Add initial noop watch cancel func (fixes #4464)
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4465
2017-10-26 13:50:30 +02:00