Skip to content

Commit c85b731

Browse files
timofey-barminPeter-Searby
authored andcommitted
MB-68545[BP]: Fix eshell after migrating to erlang 26
Note: this BP depends on Erlang/OTP 26, so should ideally be merged at the same time that as the tlm change to upgrade to OTP 26. Original commit message below: ----------------------------- We set cookie in code passed via -eval and I guess there is a race between executing -eval and -remsh. If remsh is executed first, then cookie will not be set by the time of connect. This fix explicitly sets the order for those operarations: we set the cookie first, and then start the remote shell. Change-Id: Ie9cd9ee6b5561d2e07ee25b57f3db3787bcf42eb Reviewed-on: https://review.couchbase.org/c/couchbase-cli/+/233928 Reviewed-by: Matt Hall <matt.hall@couchbase.com> Tested-by: Safian Ali <safian.ali@couchbase.com> Well-Formed: Restriction Checker
1 parent 7f570fb commit c85b731

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

cbmgr.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2149,9 +2149,12 @@ def execute(self, opts):
21492149
env = os.environ.copy()
21502150
env["CB_COOKIE"] = cookie
21512151

2152+
eval_str = 'erlang:set_cookie(list_to_atom(os:getenv("CB_COOKIE"))), ' \
2153+
f'shell:start_interactive({{remote, "{node}"}}).'
21522154
args = [path, '-name', name, '-setcookie', 'nocookie', '-hidden', '-eval',
2153-
'erlang:set_cookie(node(), list_to_atom(os:getenv("CB_COOKIE"))).',
2154-
'-remsh', node, '-proto_dist', 'cb', '-epmd_module', 'cb_epmd', '-pa', CB_NS_EBIN_PATH, '-kernel',
2155+
eval_str,
2156+
'-noshell', '-proto_dist', 'cb', '-epmd_module',
2157+
'cb_epmd', '-pa', CB_NS_EBIN_PATH, '-kernel',
21552158
'dist_config_file', f'"{temp_name}"'] + CB_INETRC_OPT
21562159

21572160
if opts.debug:

0 commit comments

Comments
 (0)