12479: Merge branch 'master' into 12479-wb-structured-vocabulary
authorLucas Di Pentima <ldipentima@veritasgenetics.com>
Mon, 8 Jan 2018 14:44:38 +0000 (11:44 -0300)
committerLucas Di Pentima <ldipentima@veritasgenetics.com>
Mon, 8 Jan 2018 17:40:44 +0000 (14:40 -0300)
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima@veritasgenetics.com>

16 files changed:
README.md
build/check-copyright-notices
build/run-build-docker-jobs-image.sh
build/run-build-packages-one-target.sh
build/run-library.sh
build/run-tests.sh
doc/user/cwl/bwa-mem/bwa-mem.cwl
sdk/go/arvados/collection_fs.go
sdk/go/arvados/collection_fs_test.go
services/crunch-run/crunchrun.go
services/crunch-run/crunchrun_test.go
services/crunch-run/logging.go
services/fuse/arvados_fuse/__init__.py
services/fuse/tests/test_inodes.py
services/health/arvados-health.service [new file with mode: 0644]
services/keep-web/cadaver_test.go

index 367c3e8f60c5ccb2bb5f5490c32812ed0bbceca1..c480ffda4cca9c5141e954c75bbc41c35fd67b67 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
-[//]: # Copyright (C) The Arvados Authors. All rights reserved.
-[//]: #
-[//]: # SPDX-License-Identifier: CC-BY-SA-3.0
+[comment]: # (Copyright © The Arvados Authors. All rights reserved.)
+[comment]: # ()
+[comment]: # (SPDX-License-Identifier: CC-BY-SA-3.0)
 
 [Arvados](https://arvados.org) is a free software distributed computing platform
 for bioinformatics, data science, and high throughput analysis of massive data
@@ -46,7 +46,7 @@ doc/README.textile for instructions.
 
 ## Community
 
-The [#arvados](irc://irc.oftc.net:6667/#arvados IRC) (Internet Relay Chat)
+The [#arvados](irc://irc.oftc.net:6667/#arvados) IRC (Internet Relay Chat)
 channel at the
 [Open and Free Technology Community (irc.oftc.net)](http://www.oftc.net/oftc/)
 is available for live discussion and support.  You can use a traditional IRC
@@ -58,7 +58,7 @@ is a forum for general discussion, questions, and news about Arvados
 development.  The
 [Arvados developer mailing list](http://lists.arvados.org/mailman/listinfo/arvados-dev)
 is a forum for more technical discussion, intended for developers and
-contributers to Arvados.
+contributors to Arvados.
 
 ## Development
 
@@ -73,6 +73,10 @@ Instructions for setting up a development environment and working on specific
 components can be found on the
 ["Hacking Arvados" page of the Arvados wiki](https://dev.arvados.org/projects/arvados/wiki/Hacking).
 
+## Contributing
+
+When making a pull request, please ensure *every git commit message* includes a one-line [Developer Certificate of Origin](https://dev.arvados.org/projects/arvados/wiki/Developer_Certificate_Of_Origin). If you have already made commits without it, fix them with `git commit --amend` or `git rebase`.
+
 ## Licensing
 
 Arvados is Free Software.  See COPYING for information about Arvados Free
index 5298371bd1591fed7178cd6b839f90715b8a56c4..f087188991c5c06a3b19a3b1e38325d9d29e5c52 100755 (executable)
@@ -49,163 +49,172 @@ EOF
 
 IFS=$'\n' read -a ignores -r -d $'\000' <.licenseignore || true
 result=0
-git ls-files -z ${@} | \
-    while read -rd $'\000' fnm
+
+coproc git ls-files -z ${@} </dev/null
+while read -rd $'\000' fnm
+do
+    grepAfter=2
+    grepBefore=0
+    cs=
+    cc=
+    ce=
+    fixer=
+    if [[ ! -f ${fnm} ]] || [[ -L ${fnm} ]] || [[ ! -s ${fnm} ]]
+    then
+        continue
+    fi
+
+    ignore=
+    for pattern in "${ignores[@]}"
     do
-        grepAfter=2
-        grepBefore=0
-        cs=
-        cc=
-        ce=
-        fixer=
-        if [[ ! -f ${fnm} ]] || [[ -L ${fnm} ]] || [[ ! -s ${fnm} ]]
+        if [[ ${fnm} == ${pattern} ]]
         then
-            continue
+            ignore=1
         fi
+    done
+    if [[ ${ignore} = 1 ]]; then continue; fi
 
-        ignore=
-        for pattern in "${ignores[@]}"
-        do
-            if [[ ${fnm} == ${pattern} ]]
+    case ${fnm} in
+        Makefile | */Makefile \
+            | *.dockerfile | */Dockerfile.* | */Dockerfile | *.dockerignore \
+            | */MANIFEST.in | */fuse.conf | */gitolite.rc \
+            | *.pl | *.pm | *.PL \
+            | *.rb | *.rb.example | *.rake | *.ru \
+            | *.gemspec | */Gemfile | */Rakefile \
+            | services/login-sync/bin/* \
+            | sdk/cli/bin/* \
+            | *.py \
+            | sdk/python/bin/arv-* \
+            | sdk/cwl/bin/* \
+            | services/nodemanager/bin/* \
+            | services/fuse/bin/* \
+            | tools/crunchstat-summary/bin/* \
+            | crunch_scripts/* \
+            | *.yaml | *.yml | *.yml.example | *.cwl \
+            | *.sh | *.service \
+            | */run | */run-service | */restart-dns-server \
+            | */nodemanager/doc/*.cfg \
+            | */nodemanager/tests/fake*.cfg.template \
+            | */nginx.conf \
+            | build/build.list)
+            fixer=fixer
+            cc="#"
+            ;;
+        *.md)
+            fixer=fixer
+            cc="[//]: #"
+            ;;
+        *.rst)
+            fixer=fixer
+            cc=".."
+            ;;
+        *.erb)
+            fixer=fixer
+            cs="<%# "
+            cc=""
+            ce=" %>"
+            ;;
+        *.liquid)
+            fixer=fixer
+            cs=$'{% comment %}\n'
+            cc=""
+            ce=$'\n{% endcomment %}'
+            grepAfter=3
+            grepBefore=1
+            ;;
+        *.textile)
+            fixer=fixer
+            cs="###. "
+            cc="...."
+            ce=
+            ;;
+        *.css)
+            fixer=fixer
+            cs="/* "
+            cc=""
+            ce=" */"
+            ;;
+        *.coffee)
+            fixer=fixer
+            cs="### "
+            cc=""
+            ce=" ###"
+            ;;
+        *.go | *.scss | *.java | *.js)
+            fixer=fixer
+            cc="//"
+            ;;
+        *.sql)
+            fixer=fixer
+            cc="--"
+            ;;
+        *.html | *.svg)
+            fixer=fixer
+            cs="<!-- "
+            cc=""
+            ce=" -->"
+            ;;
+        *)
+            cc="#"
+            hashbang=$(head -n1 ${fnm})
+            if [[ ${hashbang} = "#!/bin/sh" ]] ||  [[ ${hashbang} = "#!/bin/bash" ]]
             then
-                ignore=1
-            fi
-        done
-        if [[ ${ignore} = 1 ]]; then continue; fi
-
-        case ${fnm} in
-            Makefile | */Makefile \
-                | *.dockerfile | */Dockerfile.* | */Dockerfile | *.dockerignore \
-                | */MANIFEST.in | */fuse.conf | */gitolite.rc \
-                | *.pl | *.pm | *.PL \
-                | *.rb | *.rb.example | *.rake | *.ru \
-                | *.gemspec | */Gemfile | */Rakefile \
-                | services/login-sync/bin/* \
-                | sdk/cli/bin/* \
-                | *.py \
-                | sdk/python/bin/arv-* \
-                | sdk/cwl/bin/* \
-                | services/nodemanager/bin/* \
-                | services/fuse/bin/* \
-                | tools/crunchstat-summary/bin/* \
-                | crunch_scripts/* \
-                | *.yaml | *.yml | *.yml.example | *.cwl \
-                | *.sh | *.service \
-                | */run | */run-service | */restart-dns-server \
-                | */nodemanager/doc/*.cfg \
-                | */nodemanager/tests/fake*.cfg.template \
-                | */nginx.conf \
-                | build/build.list)
-                fixer=fixer
-                cc="#"
-                ;;
-            *.md)
-                fixer=fixer
-                cc="[//]: #"
-                ;;
-            *.rst)
-                fixer=fixer
-                cc=".."
-                ;;
-            *.erb)
-                fixer=fixer
-                cs="<%# "
-                cc=""
-                ce=" %>"
-                ;;
-            *.liquid)
-                fixer=fixer
-                cs=$'{% comment %}\n'
-                cc=""
-                ce=$'\n{% endcomment %}'
-                grepAfter=3
-                grepBefore=1
-                ;;
-            *.textile)
-                fixer=fixer
-                cs="###. "
-                cc="...."
-                ce=
-                ;;
-            *.css)
-                fixer=fixer
-                cs="/* "
-                cc=""
-                ce=" */"
-                ;;
-            *.coffee)
                 fixer=fixer
-                cs="### "
-                cc=""
-                ce=" ###"
-                ;;
-            *.go | *.scss | *.java | *.js)
-                fixer=fixer
-                cc="//"
-                ;;
-            *.sql)
-                fixer=fixer
-                cc="--"
-                ;;
-            *.html | *.svg)
-                fixer=fixer
-                cs="<!-- "
-                cc=""
-                ce=" -->"
-                ;;
-            *)
-                cc="#"
-                hashbang=$(head -n1 ${fnm})
-                if [[ ${hashbang} = "#!/bin/sh" ]] ||  [[ ${hashbang} = "#!/bin/bash" ]]
-                then
-                    fixer=fixer
-                fi
-                ;;
-        esac
-        wantGPL="${cs:-${cc}${cc:+ }}Copyright (C) The Arvados Authors. All rights reserved.
+            fi
+            ;;
+    esac
+    wantGPL="${cs:-${cc}${cc:+ }}Copyright (C) The Arvados Authors. All rights reserved.
 ${cc}
 ${cc}${cc:+ }SPDX-License-Identifier: AGPL-3.0${ce}"
-        wantApache="${cs:-${cc}${cc:+ }}Copyright (C) The Arvados Authors. All rights reserved.
+    wantApache="${cs:-${cc}${cc:+ }}Copyright (C) The Arvados Authors. All rights reserved.
 ${cc}
 ${cc}${cc:+ }SPDX-License-Identifier: Apache-2.0${ce}"
-        wantBYSA="${cs:-${cc}${cc:+ }}Copyright (C) The Arvados Authors. All rights reserved.
+    wantBYSA="${cs:-${cc}${cc:+ }}Copyright (C) The Arvados Authors. All rights reserved.
 ${cc}
 ${cc}${cc:+ }SPDX-License-Identifier: CC-BY-SA-3.0${ce}"
-        found=$(head -n20 "$fnm" | egrep -A${grepAfter} -B${grepBefore} 'Copyright.*Arvados' || true)
-        case ${fnm} in
-            Makefile | build/* | lib/* | tools/* | apps/* | services/* | sdk/cli/bin/crunch-job)
-                want=${wantGPL}
-                ;;
-            crunch_scripts/* | backports/* | docker/* | sdk/*)
-                want=${wantApache}
-                ;;
-            README.md | doc/*)
-                want=${wantBYSA}
-                ;;
-            *)
-                want=
-                ;;
-        esac
-        case "$found" in
-            "$wantGPL")
-                ;;
-            "$wantApache")
-                ;;
-            "$wantBYSA")
-                ;;
-            "")
-                if [[ -z ${found} ]] && [[ -n ${want} ]] && [[ $fix = true ]] && [[ $fixer != "" ]]
-                then
-                    ${fixer} ${fnm}
-                else
-                    echo "missing copyright notice: $fnm"
-                    result=1
-                fi
-                ;;
-            *)
-                echo "nonstandard copyright notice: $fnm '${found}'"
+    wantBYSAmd="[comment]: # (Copyright © The Arvados Authors. All rights reserved.)
+[comment]: # ()
+[comment]: # (SPDX-License-Identifier: CC-BY-SA-3.0)"
+    found=$(head -n20 "$fnm" | egrep -A${grepAfter} -B${grepBefore} 'Copyright.*Arvados' || true)
+    case ${fnm} in
+        Makefile | build/* | lib/* | tools/* | apps/* | services/* | sdk/cli/bin/crunch-job)
+            want=${wantGPL}
+            ;;
+        crunch_scripts/* | backports/* | docker/* | sdk/*)
+            want=${wantApache}
+            ;;
+        doc/*)
+            want=${wantBYSA}
+            ;;
+        README.md)
+            want=${wantBYSAmd}
+            ;;
+        *)
+            want=
+            ;;
+    esac
+    case "$found" in
+        "$wantGPL")
+            ;;
+        "$wantApache")
+            ;;
+        "$wantBYSA")
+            ;;
+        "$wantBYSAmd")
+            ;;
+        "")
+            if [[ -z ${found} ]] && [[ -n ${want} ]] && [[ $fix = true ]] && [[ $fixer != "" ]]
+            then
+                ${fixer} ${fnm}
+            else
+                echo "missing copyright notice: $fnm"
                 result=1
-                ;;
-        esac
-    done
+            fi
+            ;;
+        *)
+            echo "nonstandard copyright notice: $fnm '${found}'"
+            result=1
+            ;;
+    esac
+done <&${COPROC[0]}
 exit $result
index fb970affb4c4bbe94ef5a7281a2389732044aae9..d221844c8a0e1fd426afd7c3d6e7ea416ba0da9c 100755 (executable)
@@ -8,13 +8,13 @@ function usage {
     echo >&2 "usage: $0 [options]"
     echo >&2
     echo >&2 "$0 options:"
+    echo >&2 "  -t, --tags                    version tag for docker"
     echo >&2 "  -u, --upload                  Upload the images (docker push)"
     echo >&2 "  --no-cache                    Don't use build cache"
     echo >&2 "  -h, --help                    Display this help and exit"
     echo >&2
     echo >&2 "  If no options are given, just builds the images."
 }
-
 upload=false
 
 # NOTE: This requires GNU getopt (part of the util-linux package on Debian-based distros).
@@ -45,7 +45,7 @@ do
                   exit 1
                   ;;
                 *)
-                  echo "WARNING: --tags is deprecated and doesn't do anything";
+                  version_tag="$2";
                   shift 2
                   ;;
             esac
@@ -156,8 +156,11 @@ if docker --version |grep " 1\.[0-9]\." ; then
     # -f flag removed in Docker 1.12
     FORCE=-f
 fi
-
-docker tag $FORCE arvados/jobs:$cwl_runner_version arvados/jobs:latest
+if ! [[ -z "$version_tag" ]]; then
+    docker tag $FORCE arvados/jobs:$cwl_runner_version arvados/jobs:"$version_tag"
+else
+    docker tag $FORCE arvados/jobs:$cwl_runner_version arvados/jobs:latest
+fi
 
 ECODE=$?
 
@@ -179,9 +182,12 @@ else
         ## 20150526 nico -- *sometimes* dockerhub needs re-login
         ## even though credentials are already in .dockercfg
         docker login -u arvados
-
-        docker_push arvados/jobs:$cwl_runner_version
-        docker_push arvados/jobs:latest
+        if ! [[ -z "$version_tag" ]]; then
+            docker_push arvados/jobs:"$version_tag"
+        else
+           docker_push arvados/jobs:$cwl_runner_version
+           docker_push arvados/jobs:latest
+        fi
         title "upload arvados images finished (`timer`)"
     else
         title "upload arvados images SKIPPED because no --upload option set (`timer`)"
index ff82e46e049b2014889ffc237a53258fd03e70ae..983c221f3b3b74f7235b04057cb3bd1bee1f9dba 100755 (executable)
@@ -161,6 +161,7 @@ popd
 
 if test -z "$packages" ; then
     packages="arvados-api-server
+        arvados-docker-cleaner
         arvados-git-httpd
         arvados-node-manager
         arvados-src
@@ -179,10 +180,6 @@ if test -z "$packages" ; then
         python-arvados-fuse
         python-arvados-python-client
         python-arvados-cwl-runner"
-
-    if [[ $TARGET != centos7 ]]; then
-        packages="$packages arvados-docker-cleaner"
-    fi
 fi
 
 FINAL_EXITCODE=0
index 6d46eb1108f29a70c527a9049918ae1643a281a9..c5312f8d8c519be54e3b4b06facde6049094f2b4 100755 (executable)
@@ -349,11 +349,13 @@ fpm_build () {
   fi
 
   local default_iteration_value="$(default_iteration "$PACKAGE" "$VERSION" "$PACKAGE_TYPE")"
+  local python=""
 
   case "$PACKAGE_TYPE" in
       python)
           # All Arvados Python2 packages depend on Python 2.7.
           # Make sure we build with that for consistency.
+          python=python2.7
           set -- "$@" --python-bin python2.7 \
               --python-easyinstall "$EASY_INSTALL2" \
               --python-package-name-prefix "$PYTHON2_PKG_PREFIX" \
@@ -369,6 +371,7 @@ fpm_build () {
           # necessary arguments to fpm's command line later, after we're
           # done handling positional arguments.
           PACKAGE_TYPE=python
+          python=python3
           set -- "$@" --python-bin python3 \
               --python-easyinstall "$EASY_INSTALL3" \
               --python-package-name-prefix "$PYTHON3_PKG_PREFIX" \
@@ -392,8 +395,10 @@ fpm_build () {
   # packages cleanup on upgrade depends on files being listed on the %files
   # section in the generated SPEC files. To remove DIRECTORIES, they need to
   # be listed in that sectiontoo, so we need to add this parameter to properly
-  # remove lingering dirs.
-  if [[ rpm = "$FORMAT" ]]; then
+  # remove lingering dirs. But this only works for python2: if used on
+  # python33, it includes dirs like /opt/rh/python33 that belong to
+  # other packages.
+  if [[ "$FORMAT" = rpm ]] && [[ "$python" = python2.7 ]]; then
     COMMAND_ARR+=('--rpm-auto-add-directories')
   fi
 
index 7d6cb9ec8b81dc20dc9094cd33a564805a8a6f16..f6c6e8f553fd93b0355cf9ce0224fc75495cc6d7 100755 (executable)
@@ -475,7 +475,7 @@ export PERLLIB="$PERLINSTALLBASE/lib/perl5:${PERLLIB:+$PERLLIB}"
 export GOPATH
 mkdir -p "$GOPATH/src/git.curoverse.com"
 rmdir --parents "$GOPATH/src/git.curoverse.com/arvados.git/tmp/GOPATH"
-ln -sfT "$WORKSPACE" "$GOPATH/src/git.curoverse.com/arvados.git" \
+ln -snfT "$WORKSPACE" "$GOPATH/src/git.curoverse.com/arvados.git" \
     || fatal "symlink failed"
 go get -v github.com/kardianos/govendor \
     || fatal "govendor install failed"
index b5c9f82a1a5f79970a97e92d91fce7de9268430c..20019712645902dbd1962b86a48bb8e59643c7b9 100755 (executable)
@@ -8,9 +8,9 @@ class: CommandLineTool
 
 hints:
   DockerRequirement:
-    dockerPull: biodckr/bwa
+    dockerPull: lh3lh3/bwa
 
-baseCommand: [bwa, mem]
+baseCommand: [mem]
 
 arguments:
   - {prefix: "-t", valueFrom: $(runtime.cores)}
index 7bbbaa492c71298157f3cfebc96dfade89966ae0..d8ee2a2b1c5175697bf39369274ff6c0a42e7310 100644 (file)
@@ -1078,6 +1078,10 @@ func (dn *dirnode) Rename(oldname, newname string) error {
        if !ok {
                return os.ErrNotExist
        }
+       if locked[oldinode] {
+               // oldinode cannot become a descendant of itself.
+               return ErrInvalidArgument
+       }
        if existing, ok := newdn.inodes[newname]; ok {
                // overwriting an existing file or dir
                if dn, ok := existing.(*dirnode); ok {
index 57ba3255947439ded25834e6b8841cd51fe70f48..bd5d08bcf5e8f278606be6bac2037ce7b9215ecb 100644 (file)
@@ -599,6 +599,30 @@ func (s *CollectionFSSuite) TestRemove(c *check.C) {
        c.Check(err, check.IsNil)
 }
 
+func (s *CollectionFSSuite) TestRenameError(c *check.C) {
+       fs, err := (&Collection{}).FileSystem(s.client, s.kc)
+       c.Assert(err, check.IsNil)
+       err = fs.Mkdir("first", 0755)
+       c.Assert(err, check.IsNil)
+       err = fs.Mkdir("first/second", 0755)
+       c.Assert(err, check.IsNil)
+       f, err := fs.OpenFile("first/second/file", os.O_CREATE|os.O_WRONLY, 0755)
+       c.Assert(err, check.IsNil)
+       f.Write([]byte{1, 2, 3, 4, 5})
+       f.Close()
+       err = fs.Rename("first", "first/second/third")
+       c.Check(err, check.Equals, ErrInvalidArgument)
+       err = fs.Rename("first", "first/third")
+       c.Check(err, check.Equals, ErrInvalidArgument)
+       err = fs.Rename("first/second", "second")
+       c.Check(err, check.IsNil)
+       f, err = fs.OpenFile("second/file", 0, 0)
+       c.Assert(err, check.IsNil)
+       data, err := ioutil.ReadAll(f)
+       c.Check(err, check.IsNil)
+       c.Check(data, check.DeepEquals, []byte{1, 2, 3, 4, 5})
+}
+
 func (s *CollectionFSSuite) TestRename(c *check.C) {
        fs, err := (&Collection{}).FileSystem(s.client, s.kc)
        c.Assert(err, check.IsNil)
index 8fd5801d236015b28ae125d56f787b3a236064cf..e5e0ea001669f21219c8f6d01717f7771b885f59 100644 (file)
@@ -664,7 +664,6 @@ type infoCommand struct {
 // purposes.
 func (runner *ContainerRunner) LogNodeInfo() (err error) {
        w := runner.NewLogWriter("node-info")
-       logger := log.New(w, "node-info", 0)
 
        commands := []infoCommand{
                {
@@ -690,17 +689,17 @@ func (runner *ContainerRunner) LogNodeInfo() (err error) {
        }
 
        // Run commands with informational output to be logged.
-       var out []byte
        for _, command := range commands {
-               out, err = exec.Command(command.cmd[0], command.cmd[1:]...).CombinedOutput()
-               if err != nil {
-                       return fmt.Errorf("While running command %q: %v",
-                               command.cmd, err)
-               }
-               logger.Println(command.label)
-               for _, line := range strings.Split(string(out), "\n") {
-                       logger.Println(" ", line)
+               fmt.Fprintln(w, command.label)
+               cmd := exec.Command(command.cmd[0], command.cmd[1:]...)
+               cmd.Stdout = w
+               cmd.Stderr = w
+               if err := cmd.Run(); err != nil {
+                       err = fmt.Errorf("While running command %q: %v", command.cmd, err)
+                       fmt.Fprintln(w, err)
+                       return err
                }
+               fmt.Fprintln(w, "")
        }
 
        err = w.Close()
index 652b50d1798ac42fa5a2df59731b6059ba8959e6..ab7417e542bee44fa2346e50a97732ec3b41304b 100644 (file)
@@ -951,7 +951,7 @@ func (s *TestSuite) testStopContainer(c *C, setup func(cr *ContainerRunner)) {
 
        c.Check(api.CalledWith("container.log", nil), NotNil)
        c.Check(api.CalledWith("container.state", "Cancelled"), NotNil)
-       c.Check(strings.HasSuffix(api.Logs["stdout"].String(), "foo\n"), Equals, true)
+       c.Check(api.Logs["stdout"].String(), Matches, "(?ms).*foo\n$")
 }
 
 func (s *TestSuite) TestFullRunSetEnv(c *C) {
index 0083f0999ce7f27a4c50e94729e3dbd344f89a4e..ce0a6612633fbe713a6775c7ad23ede9881a6ad4 100644 (file)
@@ -221,7 +221,7 @@ type ArvLogWriter struct {
        closing                      bool
 }
 
-func (arvlog *ArvLogWriter) Write(p []byte) (n int, err error) {
+func (arvlog *ArvLogWriter) Write(p []byte) (int, error) {
        // Write to the next writer in the chain (a file in Keep)
        var err1 error
        if arvlog.writeCloser != nil {
@@ -230,7 +230,6 @@ func (arvlog *ArvLogWriter) Write(p []byte) (n int, err error) {
 
        // write to API after checking rate limit
        now := time.Now()
-       bytesWritten := 0
 
        if now.After(arvlog.logThrottleResetTime) {
                // It has been more than throttle_period seconds since the last
@@ -275,7 +274,6 @@ func (arvlog *ArvLogWriter) Write(p []byte) (n int, err error) {
                        "properties":  map[string]string{"text": arvlog.bufToFlush.String()}}}
                err2 := arvlog.ArvClient.Create("logs", lr, nil)
 
-               bytesWritten = arvlog.bufToFlush.Len()
                arvlog.bufToFlush = bytes.Buffer{}
                arvlog.bufFlushedAt = now
 
@@ -284,7 +282,7 @@ func (arvlog *ArvLogWriter) Write(p []byte) (n int, err error) {
                }
        }
 
-       return bytesWritten, nil
+       return len(p), nil
 }
 
 // Close the underlying writer
index 418f748fe1a25fe65232abd904312bf44267992d..788d475e33c0d094d719503e6b9fc4dba386e1ec 100644 (file)
@@ -159,10 +159,11 @@ class InodeCache(object):
             if obj.in_use():
                 _logger.debug("InodeCache cannot clear inode %i, in use", obj.inode)
                 return
-            obj.kernel_invalidate()
             if obj.has_ref(True):
-                _logger.debug("InodeCache sent kernel invalidate inode %i", obj.inode)
+                _logger.debug("InodeCache cannot clear inode %i, still referenced", obj.inode)
                 return
+            obj.kernel_invalidate()
+            _logger.debug("InodeCache sent kernel invalidate inode %i", obj.inode)
             obj.clear()
 
         # The llfuse lock is released in del_entry(), which is called by
index cd3b3bb2ab2662256f0b27a7658023d703aabb8f..07e6036d08752ae6993bb5c2e8156aeb47454d65 100644 (file)
@@ -112,7 +112,7 @@ class InodeTests(unittest.TestCase):
         cache.touch(ent3)
         self.assertFalse(ent1.clear.called)
         self.assertFalse(ent3.clear.called)
-        self.assertTrue(ent3.kernel_invalidate.called)
+        self.assertFalse(ent3.kernel_invalidate.called)
         self.assertEqual(1100, cache.total())
 
         # ent1 still in use, ent3 doesn't have ref,
diff --git a/services/health/arvados-health.service b/services/health/arvados-health.service
new file mode 100644 (file)
index 0000000..a3d0365
--- /dev/null
@@ -0,0 +1,22 @@
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
+
+[Unit]
+Description=Arvados healthcheck server
+Documentation=https://doc.arvados.org/
+After=network.target
+AssertPathExists=/etc/arvados/config.yml
+# systemd<230
+StartLimitInterval=0
+# systemd>=230
+StartLimitIntervalSec=0
+
+[Service]
+Type=simple
+ExecStart=/usr/bin/arvados-health
+Restart=always
+RestartSec=1s
+
+[Install]
+WantedBy=multi-user.target
index d4a89c844b567a4d2fb8d3a94f8138e365a672d7..eb323674b9013daa80b7ee7bc1d472dcdd21cf01 100644 (file)
@@ -131,6 +131,17 @@ func (s *IntegrationSuite) TestWebdavWithCadaver(c *check.C) {
                        cmd:   "move newdir0/testfile newdir1/\n",
                        match: `(?ms).*Moving .* succeeded.*`,
                },
+               {
+                       path:  writePath,
+                       cmd:   "move newdir1 newdir1/\n",
+                       match: `(?ms).*Moving .* failed.*`,
+               },
+               {
+                       path:  writePath,
+                       cmd:   "get newdir1/testfile '" + checkfile.Name() + "'\n",
+                       match: `(?ms).*succeeded.*`,
+                       data:  testdata,
+               },
                {
                        path:  writePath,
                        cmd:   "put '" + localfile.Name() + "' newdir1/testfile1\n",