Commit graph

12714 commits

Author SHA1 Message Date
Joey Hess
6f954bfe76
close 2025-09-16 11:00:30 -04:00
Joey Hess
b129c95145
comment 2025-09-16 10:44:04 -04:00
yarikoptic
3b70bd683a Added a comment 2025-09-16 00:40:22 +00:00
Joey Hess
3e9807bc03
work around file-io not setting locale encoding when opening a Handle
Works around this bug https://github.com/haskell/file-io/issues/45

The fix is in Utility.FileIO.CloseOnExec because all use of file-io is
already wrapped through that module. Although perhaps that ought to be
refactored at this point.

I'd hope that file-io will eventually fix this bug, and also provide
CloseOnExec variants of its functions. That would allow depending on the
fixed version, and removing this ugly code.

Note that, functions like readFile that don't care about the encoding
due to reading/writing a ByteString were kept optimally fast by not
setting the encoding. This avoids an IORef read and write per open.

Sponsored-by: Graham Spencer
2025-09-15 19:25:03 -04:00
Joey Hess
0e7d469f89
bug 2025-09-15 18:50:42 -04:00
Joey Hess
e85ca915fb
comment 2025-09-15 16:13:25 -04:00
Joey Hess
6ef3cc834c
update 2025-09-15 14:27:45 -04:00
Joey Hess
7222941aa5
comment 2025-09-15 14:25:08 -04:00
Joey Hess
11e7211d7b
drop problem end characters from filename operating on String not RawFilePath
Fix bug that could cause an invalid utf-8 sequence to be used in a
temporary filename when the input filename was valid utf-8.

Sponsored-by: k0ld
2025-09-15 13:42:50 -04:00
yarikoptic
707d4e5fac Added a comment 2025-09-15 17:11:51 +00:00
Joey Hess
a9bf5cfcf3
comment 2025-09-15 12:15:51 -04:00
Joey Hess
d46c445e24
reopen 2025-09-15 12:07:29 -04:00
yarikoptic
3209cf25e0 Added a comment 2025-09-11 15:46:53 +00:00
yarikoptic
379b380507 Added a comment 2025-09-11 12:30:50 +00:00
git-annex.branchable.com-2746523870@d0bf050902d9409ff6e93b060e84e482d7e91e7f
84926d1659 2025-09-11 12:25:06 +00:00
git-annex.branchable.com-2746523870@d0bf050902d9409ff6e93b060e84e482d7e91e7f
dd43d49d1e 2025-09-11 12:23:36 +00:00
Joey Hess
38786a4e5e
noCreateProcessWhile to fix close-on-exec races
Sponsored-by: the NIH-funded NICEMAN (ReproNim TR&D3) project
2025-09-10 14:29:15 -04:00
Joey Hess
4fd71c125e
Improve performance when used with a local git remote that has a large working tree
git write-tree was being run once per file git-annex acts on when eg,
getting files, which is slow when the remote repository has a large
tree.

onLocal calls quiesce after each action, and quiesce closes the keys db
since [[!commit ba7ecbc6a9c]]. Which has a relevant comment about
performance. I have not addressed that, the keys db still gets closed and
reopened after each file.

Turns out that, since git write-tree was run by each call to
reconcileStaged, the .git/annex/keysdb.cache value was never the
same as the git index's inode. Because git write-tree updates the index's
mtime even when no changes have been made.

And so, when the database got closed and reopened, reconcileStaged would
see a changed index, and run git write-tree again. Over and over.

I considered writing the index's new inodecache after write-tree to the
keysdb.cache, but that would be vulnerable to a race, if the index was
changed just after write-tree.

The fix was to stop using keysb.cache at all. When the database is closed
and later reopened by the same process, avoid re-doing reconcileStaged.

Now that .git/annex/keysdb.cache is no longer used. It could be removed,
but the time overhead of removing it would be more than the space overhead
of keeping it. Defferred removal to the v11 upgrade.

Sponsored-by: unqueued
2025-09-10 12:08:11 -04:00
Joey Hess
16c54d458a
Merge branch 'master' of ssh://git-annex.branchable.com 2025-09-10 10:22:10 -04:00
Joey Hess
34d5cc055e
bug report 2025-09-10 10:16:52 -04:00
yarikoptic
9b28a6b314 initial report on problem with # in the path 2025-09-09 14:36:29 +00:00
babudarabu@232a9694ce5401143f6210561371f887dd15cd61
ab9bbeabd5 Added a comment 2025-09-08 17:13:02 +00:00
Joey Hess
52303a4cc3
comments 2025-09-06 13:38:17 -04:00
Joey Hess
d838836aca
update 2025-09-05 16:18:07 -04:00
Joey Hess
2b1e9eced2
open feed file with close-on-exec bit set
parseFeedFromFile does not set the bit, so open and read the file
ourselves.

Versioned dependency on utf8-string should not cause any issues,
that version is available in all all versions of debian that package it.

Sponsored-by: the NIH-funded NICEMAN (ReproNim TR&D3) project
2025-09-05 16:02:17 -04:00
Joey Hess
56cd59a9f4
clarify 2025-09-05 15:49:33 -04:00
Joey Hess
314ce317bf
update 2025-09-05 15:48:43 -04:00
Joey Hess
171b427eb8
update 2025-09-05 14:07:40 -04:00
Joey Hess
9a2013a2e7
update 2025-09-05 14:06:15 -04:00
Joey Hess
d8f40288f1
update 2025-09-05 11:21:38 -04:00
Joey Hess
1230ac83e9
copyFile 2025-09-05 11:17:14 -04:00
Joey Hess
cb6f28282a
on libraries 2025-09-04 18:09:57 -04:00
Joey Hess
2b2e76e73f
format 2025-09-04 16:56:19 -04:00
Joey Hess
10fcd61966
fix format 2025-09-04 16:40:59 -04:00
Joey Hess
7b711ffd3b
Revert "try to fix format issue on website"
This reverts commit 764b47d7d4.
2025-09-04 16:40:50 -04:00
Joey Hess
764b47d7d4
try to fix format issue on website 2025-09-04 16:38:55 -04:00
Joey Hess
807ae0ad26
Merge branch 'master' of ssh://git-annex.branchable.com 2025-09-04 16:31:25 -04:00
Joey Hess
eff0c509f7
more 2025-09-04 16:31:09 -04:00
yarikoptic
d67f578049 added project 2025-09-04 20:13:07 +00:00
Joey Hess
033e4b086f
audit all openFd and dupping for close-on-exec
Made all uses of openFd and dup set the close-on-exec flag, with a few
exceptions when starting a git-annex daemon.

Made openFdWithMode be used everywhere, rather than openFd.
Adding a new parameter to it ensures I checked everything.
And will help to make sure this gets considered in the future when
opening fds.

In lockPidFile, the only thing that keeps the pid file locked, once
daemonize re-runs the command in a new session, is that the fd is
inherited.

In Utility.LogFile.redir, the new fd it dups to does not have the
close-on-exec flag set, because this is used to set up the stdout and
stderr fds, which need to be inherited by child processes.

Same in Assistant.startDaemon where the browser gets started with the
original stdout and stderr.

This does nothing about uses of openFile and similar!

Sponsored-By: mycroft
2025-09-04 16:01:41 -04:00
Joey Hess
e1dcf98b78
analysis 2025-09-04 14:46:44 -04:00
Joey Hess
b2b055a634
analysis 2025-09-04 14:23:13 -04:00
Joey Hess
d44fd44c92
comment 2025-09-04 13:32:12 -04:00
Joey Hess
67f00027d1
avoid relatedTemplate ever returning ""
add: Fix crash adding filenames that are exactly 21 bytes long and begin
with a utf-8 character.

Also longer filenames that start with "....." would cause the same crash.

I also audited for other calls to truncateFilePath that could truncate it
to "". Most use pathmax so are not a problem. Backend.Utilities.genKeyName
could possibly truncate it like that, but appends the md5 so would not be a
problem either.

Sponsored-by: Kevin Mueller
2025-09-04 13:02:46 -04:00
yarikoptic
4b037dda81 Added a comment 2025-09-04 02:06:22 +00:00
yarikoptic
5347627025 Added a comment: odd odd filesystem 2025-09-02 15:06:43 +00:00
guardcat
da4237182e 2025-09-02 10:42:04 +00:00
guardcat
25834e7c79 2025-09-02 10:21:27 +00:00
guardcat
8e032545d8 2025-09-02 10:02:44 +00:00
guardcat
4654097a97 2025-09-02 09:32:38 +00:00