Commit graph

33245 commits

Author SHA1 Message Date
Joey Hess
77fbe17b5e
Merge branch 'master' of ssh://git-annex.branchable.com 2018-10-31 08:07:08 -04:00
Joey Hess
89ac32616f
don't move keys db out from under sqlite
Instead remove enough data from it that this regression test tests what
it needs to.

Moving the database was the last thing that made the test suite
unstable, including sometimes hanging completely. It seems that, despite
closeDb being called before the move, sqlite was not quite done with it,
and somehow this causes other sqlite handles to become unstable. Not
good.

With this change, the test suite has successfully run 100+ times without
any issues.
2018-10-31 08:04:16 -04:00
Joey Hess
1c71f563e0
explicitly close keys db in saveState
Should be redundant, but test suite is ending up with
a lot of extra sqlite connections before unused keys database handles
get garbage collected.

While running the test suite, I often saw 2-4+ open fds to the same
repo's keys database. After this change, it seems to mostly have 1,
occasionally 2.

And that might explain some of the strange sqlite failures in the test suite.
Especially the failures of test_lock_v7_force, where the keys database
gets renamed to a new directory out from under sqlite.
2018-10-30 22:19:32 -04:00
Joey Hess
fcc9eea554
avoid closeDb opening the db if it's not already open 2018-10-30 22:19:05 -04:00
Gus
a1379fe56b Added a comment: Nice! 2018-10-30 22:14:43 +00:00
Joey Hess
b144622d0d
devblog 2018-10-30 18:11:11 -04:00
Joey Hess
1428568554
retry when sqlite throws ErrorIO
I suspect this may be due to SQLITE_IOERR_SHORT_READ, but have not
verified.

I was able to reproduce it on Linux after running the test suite in a loop
for 1-3 hours until it failed.

The WAL mode entry change in 3963c5fcf5
may have hidden the problem I was seeing; I have not seen an ErrorIO
since then.
2018-10-30 18:06:38 -04:00
Joey Hess
3963c5fcf5
better approach to enabling WAL mode
The old approach opened the database an extra time to enable WAL mode,
but more recent persistent-sqlite has a better API to enable it.
2018-10-30 13:47:38 -04:00
Joey Hess
f00b329e0c
remove unused import 2018-10-30 13:38:29 -04:00
Joey Hess
a89db2c604
link to bug report blob
delete from tree
2018-10-30 12:07:38 -04:00
Joey Hess
57107cf213
sqlite bug report that the developers never responded to
Adding to git-annex's history so it doesn't get lost; the gmane archive
of it is long gone.
2018-10-30 12:04:28 -04:00
Joey Hess
718915e9fc
improve comments 2018-10-30 11:52:05 -04:00
Joey Hess
9e41a86706
Merge branch 'master' of ssh://git-annex.branchable.com 2018-10-30 11:10:21 -04:00
Joey Hess
86df2a08fe
fix windows build 2018-10-30 11:09:45 -04:00
Joey Hess
cc1087de42
test: display error messages from git-annex on unexpected failures
.. but not on expected failures
2018-10-30 10:49:39 -04:00
CandyAngel
2e0cc99b13 Add note about caching annex fulfilling this usage 2018-10-30 13:21:23 +00:00
Joey Hess
6956f533fe
better method of waiting for new mtime
This will even work on eg FAT with its 1-2 second mtime granularity. And
without slowing down everything else.
2018-10-30 01:11:04 -04:00
Joey Hess
c75807ba3a
remove note about ghc bug
ghc 8.6 fixed that, apparently
2018-10-30 00:51:14 -04:00
Joey Hess
86c316ab0f
Merge branch 'master' of ssh://git-annex.branchable.com 2018-10-30 00:46:16 -04:00
Joey Hess
5ab0f48ffb
high-res mtimes
Cache high-resolution mtimes for improved detection of modified files in v7
(and direct mode).

Including on Windows.

With back-compat support so old low-res mtimes won't break anything, and
so the new information also won't break old versions of git-annex.
2018-10-30 00:41:26 -04:00
Joey Hess
48af284872
fix parse of negative posix time
Should never happen, but..
2018-10-29 23:40:34 -04:00
Joey Hess
a8ad577d1d
fix parsing of timestamp w/o trailing 's'
Luckily, this did not affect any git-annex log files, since they all
include the trailing 's' for backwards compatability reasons.

But, if I later want to drop that, this is the first commit where
git-annex can be trusted to parse that right.

The misparse caused it to be off by up to 10 seconds.
2018-10-29 23:36:47 -04:00
Joey Hess
3d1b22dc8e
factor out another function 2018-10-29 23:33:56 -04:00
Joey Hess
2e9f128dea
moved module and relicensed 2018-10-29 23:13:36 -04:00
Joey Hess
5d97898a7c
touch files with high-resolution timestamp
Needs unix 2.7.2, but that was included in ghc 8.0.1 (and much older)
so not really a new dep.
2018-10-29 22:25:21 -04:00
Joey Hess
94b7968f1f
forgot to remove this when dropping support for old ghc 2018-10-29 22:01:06 -04:00
Ilya_Shlyakhter
d1a6daf40b added a use case for alt_keys 2018-10-30 01:40:18 +00:00
Joey Hess
cdb607d937
response 2018-10-29 19:38:19 -04:00
Joey Hess
5cb12f5adb
Merge branch 'master' of ssh://git-annex.branchable.com 2018-10-29 19:33:25 -04:00
Joey Hess
595fb98473
add small delay to avoid problems on systems with low-resolution mtime
I've seen intermittent failures of the test suite with v6 for a long time,
it seems to have possibly gotten worse with the changes around v7. Or just
being unlucky; all tests failed today.

Seen on amd64 and i386 builders, repeatedly but intermittently:

	unused: FAIL (4.86s)
	Test.hs:928:
	git diff did not show changes to unlocked file

And I think other such failures, all involving v7/v6 mode tests.

I managed to reproduce the unused failure with --keep-failures,
and inside the repo, git diff was indeed not showing any changes for
the modified unlocked file.

The two stats will be the same other than mtime; the old and new files have
the same size and inode, since the test case writes to the file and then
overwrites it.

Indeed, notice the identical timestamps:

	builder@orca:~/gitbuilder/build/.t/tmprepo335$ echo 1 > foo; stat foo; echo 2 > foo; stat foo
	  File: foo
	  Size: 2         	Blocks: 8          IO Block: 4096   regular file
	Device: 801h/2049d	Inode: 3546179     Links: 1
	Access: (0644/-rw-r--r--)  Uid: ( 1000/ builder)   Gid: ( 1000/ builder)
	Access: 2018-10-29 22:14:10.894942036 +0000
	Modify: 2018-10-29 22:14:10.894942036 +0000
	Change: 2018-10-29 22:14:10.894942036 +0000
	 Birth: -
	  File: foo
	  Size: 2         	Blocks: 8          IO Block: 4096   regular file
	Device: 801h/2049d	Inode: 3546179     Links: 1
	Access: (0644/-rw-r--r--)  Uid: ( 1000/ builder)   Gid: ( 1000/ builder)
	Access: 2018-10-29 22:14:10.894942036 +0000
	Modify: 2018-10-29 22:14:10.898942036 +0000
	Change: 2018-10-29 22:14:10.898942036 +0000
	 Birth: -

I'm seeing this in Linux VMs; it doesn't happen on my laptop. I've also
not experienced the intermittent test suite failures on my laptop.

So, I hope that this small delay will avoid the problem.

Update: I didn't, indeed I then reproduced the same failure on my
laptop, so it must be due to something else. But keeping this change anyway
since not needing to worry about lowish-resolution mtime in the test suite seems
worthwhile.
2018-10-29 19:31:26 -04:00
Gus
288041b609 2018-10-29 23:21:24 +00:00
Joey Hess
bdeba74d4d
Merge branch 'master' of ssh://git-annex.branchable.com 2018-10-29 17:11:55 -04:00
Joey Hess
16d56b7eca
remove old flags 2018-10-29 17:10:39 -04:00
Ilya_Shlyakhter
24419efa35 Added a comment 2018-10-29 21:10:29 +00:00
Joey Hess
87d770e3fd
rethink 2018-10-29 17:09:55 -04:00
Ilya_Shlyakhter
6b5f2ecf0e Added a comment 2018-10-29 21:08:55 +00:00
Joey Hess
7a050660d6
ummmmm 2018-10-29 16:48:02 -04:00
Joey Hess
4431b82bce
migrate: Fix failure to migrate from URL keys. (Reversion introduced in version 6.20180926) 2018-10-29 16:36:36 -04:00
Joey Hess
d73f92d8bc
Merge branch 'master' of ssh://git-annex.branchable.com 2018-10-29 16:01:46 -04:00
Joey Hess
c472c268c4
webapp: Fixed a crash when adding a git remote.
Reversion introduced in 2b66492d6e which added a new cache that needs to be
cleared.
2018-10-29 16:01:08 -04:00
Ilya_Shlyakhter
b6e90fd18a Added a comment 2018-10-29 19:48:36 +00:00
Ilya_Shlyakhter
50d99e19a3 added suggestion about supporting alternate keys for same content 2018-10-29 19:43:25 +00:00
Joey Hess
3beab402e6
response 2018-10-29 15:40:52 -04:00
Joey Hess
0b52f95c05
followup 2018-10-29 15:28:58 -04:00
Ilya_Shlyakhter
9b268cdcc9 added git-annex-migrate failure 2018-10-29 19:22:24 +00:00
Joey Hess
64a369a1e2
followup 2018-10-29 15:14:34 -04:00
Joey Hess
e32282aa2c
followup 2018-10-29 15:11:40 -04:00
Joey Hess
d61314e494
comment 2018-10-29 15:02:20 -04:00
Joey Hess
a622488758
remove CHECKURL-MULTI single url response special case
Removed undocumented special case in handling of a CHECKURL-MULTI response
with only a single file listed. Rather than ignoring the url that was in
the response, use it. This allows external special remotes that want to
provide some better url to do so, although I don't entirely agree with
using CHECKURL-MULTI to accomplish that. I'm more of the feeling that an
undocumented special case that throws data away is just not a good idea.

This could in theory break some external special remote program that relied
on the current behavior, but its seems unlikely that it would because such
a program must already handle the multiple url case, unless it only ever
provides a single url response to CHECKURL-MULTI.

Make addurl --file work with a single item CHECKURL-MULTI response.
It already did for external special remotes due to the special case,
but now it also will for builtin ones like the BitTorrent special remote.

This commit was sponsored by Ilya Shlyakhter on Patron.
2018-10-29 14:52:12 -04:00
Joey Hess
3248319ca1
close todo item about bug report 2018-10-29 13:47:55 -04:00