summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2011-04-25Merge branch 'js/maint-1.6.6-send-pack-stateless-rpc-deadlock-fix' into ↵Libravatar Junio C Hamano1-0/+4
js/maint-send-pack-stateless-rpc-deadlock-fix * js/maint-1.6.6-send-pack-stateless-rpc-deadlock-fix: send-pack: avoid deadlock when pack-object dies early Evil merge to adjust the way the use of pthreads in sideband-demultiplexor was decided (earlier it was "if we are not on Windows", now it is "if we are not using pthreads").
2011-04-25send-pack: avoid deadlock when pack-object dies earlyLibravatar Johannes Sixt1-0/+4
Send-pack deadlocks in two ways when pack-object dies early (for example, because there is some repo corruption). The first deadlock happens with the smart push protocol (--stateless-rpc). After the initial rev-exchange, the remote is waiting for the pack data to arrive, and the sideband demuxer at the local side continues trying to stream data from the remote repository until it gets EOF. Meanwhile, send-pack (in function pack_objects()) has noticed that pack-objects did not produce output and died. Back in send_pack(), it now tries to clean up the sideband demuxer using finish_async(). The demuxer, however, waits for the remote end to close down, the remote waits for pack data, and the reason that it still waits is that send-pack forgot to close the outgoing channel. Add the missing close() in pack_objects(). The second deadlock happens in a similar constellation when the sideband demuxer runs in a forked process (rather than in a thread). Again, the remote end waits for pack data to arrive, the sideband demuxer waits for the remote to shut down, and send-pack (in the regular clean-up) waits for the demuxer to terminate. This time, the send-pack parent process closes the writable end of the outgoing channel (in start_command() that spawned pack-objects) so that after the death of the pack-objects process all writable ends should have been closed and the remote repo should see EOF. This does not happen, however, because when the sideband demuxer was forked earlier, it also inherited a writable end; it remains open and keeps the remote repo from seeing EOF. To break this deadlock, close the writable end in the demuxer. Analyzed-by: Jeff King <peff@peff.net> Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-10Enable threaded async procedures whenever pthreads is availableLibravatar Johannes Sixt4-14/+10
Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-07Dying in an async procedure should only exit the thread, not the process.Libravatar Johannes Sixt1-0/+34
Async procedures are intended as helpers that perform a very restricted task, and the caller usually has to manage them in a larger context. Conceptually, the async procedure is not concerned with the "bigger picture" in whose context it is run. When it dies, it is not supposed to destroy this "bigger picture", but rather only its own limit view of the world. On POSIX, the async procedure is run in its own process, and exiting this process naturally had only these limited effects. On Windows (or when ASYNC_AS_THREAD is set), calling die() exited the whole process, destroying the caller (the "big picture") as well. This fixes it to exit only the thread. Without ASYNC_AS_THREAD, one particular effect of exiting the async procedure process is that it automatically closes file descriptors, most notably the writable end of the pipe that the async procedure writes to. The async API already requires that the async procedure closes the pipe ends when it exits normally. But for calls to die() no requirements are imposed. In the non-threaded case the pipe ends are closed implicitly by the exiting process, but in the threaded case, the die routine must take care of closing them. Now t5530-upload-pack-error.sh passes on Windows. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-07Reimplement async procedures using pthreadsLibravatar Johannes Sixt3-20/+34
On Windows, async procedures have always been run in threads, and the implementation used Windows specific APIs. Rewrite the code to use pthreads. A new configuration option is introduced so that the threaded implementation can also be used on POSIX systems. Since this option is intended only as playground on POSIX, but is mandatory on Windows, the option is not documented. One detail is that on POSIX it is necessary to set FD_CLOEXEC on the pipe handles. On Windows, this is not needed because pipe handles are not inherited to child processes, and the new calls to set_cloexec() are effectively no-ops. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-07Windows: more pthreads functionsLibravatar Johannes Sixt2-0/+33
This adds: pthread_self pthread_equal pthread_exit pthread_key_create pthread_setspecific pthread_getspecific Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-07Fix signature of fcntl() compatibility dummyLibravatar Johannes Sixt1-1/+1
Obviously, this function was never called with two arguments in Windows code sections, but this will be the case in a subsequent patch. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-07Make report() from usage.c public as vreportf() and use it.Libravatar Johannes Sixt4-14/+10
There exist already a number of static functions named 'report', therefore, the function name was changed. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-07Modernize t5530-upload-pack-error.Libravatar Johannes Sixt1-9/+9
Some tests did not use test_must_fail. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-04Merge branch 'maint'Libravatar Junio C Hamano2-2/+26
* maint: Update draft release notes to 1.7.0.2 Remove extra '-' from git-am(1)
2010-03-04Update draft release notes to 1.7.0.2Libravatar Junio C Hamano1-1/+25
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-04Merge branch 'jn/gitweb-config-error-die' into maintLibravatar Junio C Hamano1-3/+6
* jn/gitweb-config-error-die: gitweb: Die if there are parsing errors in config file
2010-03-04Merge branch 'jn/maint-fix-pager' into maintLibravatar Junio C Hamano10-15/+268
* jn/maint-fix-pager: tests: Fix race condition in t7006-pager t7006-pager: if stdout is not a terminal, make a new one tests: Add tests for automatic use of pager am: Fix launching of pager git svn: Fix launching of pager git.1: Clarify the behavior of the --paginate option Make 'git var GIT_PAGER' always print the configured pager Fix 'git var' usage synopsis
2010-03-04Merge branch 'tr/maint-cherry-pick-list' into maintLibravatar Junio C Hamano1-0/+3
* tr/maint-cherry-pick-list: cherry_pick_list: quit early if one side is empty
2010-03-04Merge branch 'ld/maint-diff-quiet-w' into maintLibravatar Junio C Hamano2-0/+38
* ld/maint-diff-quiet-w: git-diff: add a test for git diff --quiet -w git diff --quiet -w: check and report the status
2010-03-04Merge branch 'rs/optim-text-wrap' into maintLibravatar Junio C Hamano3-37/+42
* rs/optim-text-wrap: utf8.c: speculatively assume utf-8 in strbuf_add_wrapped_text() utf8.c: remove strbuf_write() utf8.c: remove print_spaces() utf8.c: remove print_wrapped_text()
2010-03-04Merge branch 'dp/read-not-mmap-small-loose-object' into maintLibravatar Junio C Hamano1-0/+10
* dp/read-not-mmap-small-loose-object: hash-object: don't use mmap() for small files
2010-03-04Merge branch 'np/compress-loose-object-memsave' into maintLibravatar Junio C Hamano1-14/+19
* np/compress-loose-object-memsave: sha1_file: be paranoid when creating loose objects sha1_file: don't malloc the whole compressed result when writing out objects
2010-03-04Merge branch 'jc/maint-status-preload' into maintLibravatar Junio C Hamano1-1/+1
* jc/maint-status-preload: status: preload index to optimize lstat(2) calls
2010-03-04Merge branch 'gf/maint-sh-setup-nongit-ok' into maintLibravatar Junio C Hamano1-1/+1
* gf/maint-sh-setup-nongit-ok: require_work_tree broken with NONGIT_OK
2010-03-04Merge branch 'cc/maint-bisect-paths' into maintLibravatar Junio C Hamano2-0/+11
* cc/maint-bisect-paths: bisect: error out when passing bad path parameters
2010-03-04Merge branch 'maint-1.6.6' into maintLibravatar Junio C Hamano1-1/+1
* maint-1.6.6: Remove extra '-' from git-am(1)
2010-03-04Merge branch 'maint-1.6.5' into maint-1.6.6Libravatar Junio C Hamano1-1/+1
* maint-1.6.5: Remove extra '-' from git-am(1)
2010-03-04Remove extra '-' from git-am(1)Libravatar Michal Sojka1-1/+1
Signed-off-by: Michal Sojka <sojkam1@fel.cvut.cz> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-04t9119-git-svn-info.sh: test with svn 1.6.* as wellLibravatar Michael J Gruber1-1/+2
All tests in t9119 were disabled for subversion versions other than 1.[45].*. Make the test script run with subversion 1.[456].*. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Acked-by: Eric Wong <normalperson@yhbt.net>
2010-03-04git-svn: req_svn when neededLibravatar Michael J Gruber1-0/+1
The delayed loading of SVN missed a place where SVN::Core is used. Make sure to load the package before trying to use it. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Acked-by: Eric Wong <normalperson@yhbt.net>
2010-03-03Merge branch 'maint'Libravatar Junio C Hamano1-0/+22
* maint: Start preparing for 1.7.0.2 Conflicts: RelNotes
2010-03-03Merge branch 'jh/maint-submodule-status-in-void' (early part)Libravatar Junio C Hamano1-1/+1
* 'jh/maint-submodule-status-in-void' (early part): submodule summary: do not shift a non-existent positional variable
2010-03-03submodule summary: do not shift a non-existent positional variableLibravatar Jeff King1-1/+1
When "git submodule summary" is run without any argument, we default to compare the state of index with the HEAD, but tried to shift out $1 that does not exist (and worse yet, we didn't use it). Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-02Start preparing for 1.7.0.2Libravatar Junio C Hamano2-1/+23
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-02Merge branch 'tc/maint-transport-ls-remote-with-void' into maintLibravatar Junio C Hamano2-1/+10
* tc/maint-transport-ls-remote-with-void: transport: add got_remote_refs flag
2010-03-02Merge branch 'hm/maint-imap-send-crlf' into maintLibravatar Junio C Hamano1-1/+39
* hm/maint-imap-send-crlf: git-imap-send: Convert LF to CRLF before storing patch to draft box
2010-03-02Merge branch 'sp/maint-push-sideband' into maintLibravatar Junio C Hamano10-134/+370
* sp/maint-push-sideband: receive-pack: Send internal errors over side-band #2 t5401: Use a bare repository for the remote peer receive-pack: Send hook output over side band #2 receive-pack: Wrap status reports inside side-band-64k receive-pack: Refactor how capabilities are shown to the client send-pack: demultiplex a sideband stream with status data run-command: support custom fd-set in async run-command: Allow stderr to be a caller supplied pipe Conflicts: builtin-receive-pack.c run-command.c t/t5401-update-hooks.sh
2010-03-02Merge branch 'jc/maint-fix-test-perm' into maintLibravatar Junio C Hamano2-0/+4
* jc/maint-fix-test-perm: lib-patch-mode.sh: Fix permission t6000lib: Fix permission
2010-03-02Merge branch 'np/fast-import-idx-v2' into maintLibravatar Junio C Hamano2-95/+84
* np/fast-import-idx-v2: fast-import: use the diff_delta() max_delta_size argument fast-import: honor pack.indexversion and pack.packsizelimit config vars fast-import: make default pack size unlimited fast-import: use write_idx_file() instead of custom code fast-import: use sha1write() for pack data fast-import: start using struct pack_idx_entry
2010-03-02Merge branch 'maint'Libravatar Junio C Hamano3-9/+85
* maint: gitweb: Fix project-specific feature override behavior gitweb multiple project roots documentation
2010-03-02Merge branch 'jn/maint-fix-pager'Libravatar Junio C Hamano10-15/+268
* jn/maint-fix-pager: tests: Fix race condition in t7006-pager t7006-pager: if stdout is not a terminal, make a new one tests: Add tests for automatic use of pager am: Fix launching of pager git svn: Fix launching of pager git.1: Clarify the behavior of the --paginate option Make 'git var GIT_PAGER' always print the configured pager Fix 'git var' usage synopsis
2010-03-02Merge branch 'ml/encode-header-refactor'Libravatar Junio C Hamano4-55/+33
* ml/encode-header-refactor: move encode_in_pack_object_header() to a better place refactor duplicated encode_header in pack-objects and fast-import
2010-03-02Merge branch 'jn/gitweb-config-error-die'Libravatar Junio C Hamano1-3/+6
* jn/gitweb-config-error-die: gitweb: Die if there are parsing errors in config file
2010-03-02Merge branch 'jc/for-each-ref'Libravatar Junio C Hamano1-18/+59
* jc/for-each-ref: for-each-ref --format='%(flag)' for-each-ref --format='%(symref) %(symref:short)' builtin-for-each-ref.c: check if we need to peel onion while parsing the format builtin-for-each-ref.c: comment fixes
2010-03-02Merge branch 'ld/maint-diff-quiet-w'Libravatar Junio C Hamano2-0/+38
* ld/maint-diff-quiet-w: git-diff: add a test for git diff --quiet -w git diff --quiet -w: check and report the status
2010-03-02Merge branch 'tr/maint-cherry-pick-list'Libravatar Junio C Hamano1-0/+3
* tr/maint-cherry-pick-list: cherry_pick_list: quit early if one side is empty
2010-03-02Merge branch 'rs/optim-text-wrap'Libravatar Junio C Hamano3-37/+42
* rs/optim-text-wrap: utf8.c: speculatively assume utf-8 in strbuf_add_wrapped_text() utf8.c: remove strbuf_write() utf8.c: remove print_spaces() utf8.c: remove print_wrapped_text()
2010-03-02Merge branch 'ml/send-pack-transport-refactor'Libravatar Junio C Hamano4-207/+37
* ml/send-pack-transport-refactor: refactor duplicated code in builtin-send-pack.c and transport.c
2010-03-02Merge branch 'ml/fill-mm-refactor'Libravatar Junio C Hamano4-41/+24
* ml/fill-mm-refactor: refactor duplicated fill_mm() in checkout and merge-recursive
2010-03-02Merge branch 'ml/connect-refactor'Libravatar Junio C Hamano1-54/+29
* ml/connect-refactor: connect.c: move duplicated code to a new function 'get_host_and_port'
2010-03-02Merge branch 'np/compress-loose-object-memsave'Libravatar Junio C Hamano1-14/+19
* np/compress-loose-object-memsave: sha1_file: be paranoid when creating loose objects sha1_file: don't malloc the whole compressed result when writing out objects
2010-03-02Merge branch 'dp/read-not-mmap-small-loose-object'Libravatar Junio C Hamano1-0/+10
* dp/read-not-mmap-small-loose-object: hash-object: don't use mmap() for small files
2010-03-02Merge branch 'jn/makedepend'Libravatar Junio C Hamano2-50/+182
* jn/makedepend: Makefile: clarify definition of TEST_OBJS Makefile: always remove .depend directories on 'make clean' Makefile: tuck away generated makefile fragments in .depend Teach Makefile to check header dependencies Makefile: list standalone program object files in PROGRAM_OBJS Makefile: lazily compute header dependencies Makefile: list generated object files in OBJECTS Makefile: disable default implicit rules Makefile: rearrange dependency rules Makefile: transport.o depends on branch.h now Makefile: drop dependency on $(wildcard */*.h) Makefile: clean up http-walker.o dependency rules Makefile: remove wt-status.h from LIB_H Makefile: make sure test helpers are rebuilt when headers change Makefile: add missing header file dependencies Conflicts: Makefile
2010-03-02Merge branch 'jc/maint-status-preload'Libravatar Junio C Hamano1-1/+1
* jc/maint-status-preload: status: preload index to optimize lstat(2) calls