globus / globus/globus-compute

Raise an exception when an EP fails to be registered

Open
#128 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
162
Forks
53
Avg merge
15h 29m
Merged PRs (30d)
26

Description

I configure and start my endpoint as usual:
```
(funcx) [midway2-login1] ~/funcX/funcx >funcx-endpoint configure --config ~/config.py midway
A default profile has been create for at /home/annawoodard/.funcx/midway/config.py
Configure this file and try restarting with:
$ funcx-endpoint start midway
(funcx) [midway2-login1] ~/funcX/funcx >funcx-endpoint start midway
2020-03-08 20:09:52 funcx.sdk.client.FuncXClient:89 [INFO] [instance:139637152254720] Creating client of type for service "funcX"
Starting endpoint with uuid: f358302c-9b68-4ec7-8afe-757e25988380
```

There is no indication that anything has gone wrong. But in reality, my EP has not been registered:

```
(funcx) [midway2-login1] ~/funcX/funcx >cat ~/.funcx/midway/interchange.std*
Traceback (most recent call last):
File "/home/annawoodard/miniconda3/envs/funcx/bin/funcx-endpoint", line 8, in
sys.exit(cli_run())
File "/home/annawoodard/.local/lib/python3.6/site-packages/funcx/endpoint/endpoint.py", line 462, in cli_run
start_endpoint(args, global_config=global_config.global_options)
File "/home/annawoodard/.local/lib/python3.6/site-packages/funcx/endpoint/endpoint.py", line 285, in start_endpoint
logger.info("Endpoint registered with UUID: {}".format(reg_info['endpoint_id']))
KeyError: 'endpoint_id'
Error in atexit._run_exitfuncs:
OSError: [Errno 9] Bad file descriptor

(funcx) [midway2-login1] ~/funcX/funcx >cat ~/.funcx/midway/endpoint.json
{"reason": "Failed during broker start HTTPConnectionPool(host='10.0.0.112', port=8080): Max retries exceeded with url: /register (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused',))", "status": "error"}(funcx)
```

I think in this case we should inform the user the registration has failed at the command line rather than only silently writing it to the logs.

Contributor guide

Open the contributing guide

Research direction

Start with the endpoint.py start_endpoint path shown in the traceback and reproduce the failure with funcx-endpoint start midway. Inspect how the registration response is handled when endpoint.json contains status "error"; done means registration failure is reported at the command line instead of only appearing in the logs.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.