Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-46956

[Windows] couchbase-cli attempts to share temp file with erlang

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • backlog
    • 7.0.0
    • tools
    • None
    • Untriaged
    • Windows 64-bit
    • 1
    • Yes

    Description

      cbmgr.py introduced code in http://review.couchbase.org/c/couchbase-cli/+/144593

              with tempfile.NamedTemporaryFile() as temp:
                  temp.write(f'[{{preferred_local_proto,{result["addressFamily"]}_tcp_dist}}].'.encode())
                  temp_name = temp.name
       
                  args = [path, '-name', name, '-setcookie', cookie, '-hidden', '-remsh', node, '-proto_dist', 'cb',
                          '-epmd_module', 'cb_epmd', '-pa', ns_server_ebin_path, '-kernel', 'dist_config_file',
                          f'"{temp_name}"'] + inetrc_opt
       
                  if opts.debug:
                      print(f'Running {" ".join(args)}')
       
                  try:
                      subprocess.call(args)
      

      Looking at the docs https://docs.python.org/3/library/tempfile.html it says

      tempfile.NamedTemporaryFile(mode='w+b', buffering=-1, encoding=None, newline=None, suffix=None, prefix=None, dir=None, delete=True, *, errors=None)ΒΆ
      <snip>
      Whether the name can be used to open the file a second time, while the named temporary file is still open, varies across platforms (it can be so used on Unix; it cannot on Windows NT or later).
      

      So the use of the named temp file between couchbase-cli and erlang is not supported.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              pvarley Patrick Varley (Inactive)
              steve.watanabe Steve Watanabe
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty