cloud-bulldozer / cloud-bulldozer/benchmark-comparison

If index isn't found for meta - catch exception, WARN message

Open
#57 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
1
Forks
23
PR merge metrics
No merged PRs in 30d

Description

Instead of dumping the exception of index not found, catch, print a warning message, and continue.

```
+--------------+-------------------------+--------------------------------------+------------------------------------------------+
| ['pod_name'] | metadata | fa458c42-2f61-52f6-b403-a7676bdfa702 | value |
+--------------+-------------------------+--------------------------------------+------------------------------------------------+
| pod_name | backpack-fa458c42-nmwk9 | value.Model name | Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz |
| pod_name | backpack-fa458c42-nmwk9 | value.Architecture | x86_64 |
| pod_name | backpack-fa458c42-nmwk9 | value.CPU(s) | 2 |
| pod_name | backpack-fa458c42-qq2qp | value.Model name | Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz |
| pod_name | backpack-fa458c42-qq2qp | value.Architecture | x86_64 |
| pod_name | backpack-fa458c42-qq2qp | value.CPU(s) | 2 |
+--------------+-------------------------+--------------------------------------+------------------------------------------------+
+--------------+-------------------------+--------------------------------------+------------+
| ['pod_name'] | metadata | fa458c42-2f61-52f6-b403-a7676bdfa702 | value |
+--------------+-------------------------+--------------------------------------+------------+
| pod_name | backpack-fa458c42-nmwk9 | value.MemTotal | 7934444 kB |
| pod_name | backpack-fa458c42-qq2qp | value.MemTotal | 7934444 kB |
+--------------+-------------------------+--------------------------------------+------------+
Traceback (most recent call last):
File "/home/jtaleric/dev/benchmark-comparison/demo/bin/touchstone_compare", line 33, in
sys.exit(load_entry_point('touchstone==0.0.0', 'console_scripts', 'touchstone_compare')())
File "/home/jtaleric/dev/benchmark-comparison/demo/lib64/python3.10/site-packages/touchstone-0.0.0-py3.10.egg/touchstone/compare.py", line 244, in render
main(sys.argv[1:])
File "/home/jtaleric/dev/benchmark-comparison/demo/lib64/python3.10/site-packages/touchstone-0.0.0-py3.10.egg/touchstone/compare.py", line 153, in main
database_instance.get_metadata(uuid, metadata_search_map[index], index, metadata_dict)
File "/home/jtaleric/dev/benchmark-comparison/demo/lib64/python3.10/site-packages/touchstone-0.0.0-py3.10.egg/touchstone/databases/elasticsearch.py", line 142, in get_metadata
response = s.execute()
File "/home/jtaleric/dev/benchmark-comparison/demo/lib64/python3.10/site-packages/elasticsearch_dsl-7.3.0-py3.10.egg/elasticsearch_dsl/search.py", line 715, in execute
self, es.search(index=self._index, body=self.to_dict(), **self._params)
File "/home/jtaleric/dev/benchmark-comparison/demo/lib64/python3.10/site-packages/elasticsearch-7.13.4-py3.10.egg/elasticsearch/client/utils.py", line 168, in _wrapped
return func(*args, params=params, headers=headers, **kwargs)
File "/home/jtaleric/dev/benchmark-comparison/demo/lib64/python3.10/site-packages/elasticsearch-7.13.4-py3.10.egg/elasticsearch/client/__init__.py", line 1670, in search
return self.transport.perform_request(
File "/home/jtaleric/dev/benchmark-comparison/demo/lib64/python3.10/site-packages/elasticsearch-7.13.4-py3.10.egg/elasticsearch/transport.py", line 415, in perform_request
raise e
File "/home/jtaleric/dev/benchmark-comparison/demo/lib64/python3.10/site-packages/elasticsearch-7.13.4-py3.10.egg/elasticsearch/transport.py", line 381, in perform_request
status, headers_response, data = connection.perform_request(
File "/home/jtaleric/dev/benchmark-comparison/demo/lib64/python3.10/site-packages/elasticsearch-7.13.4-py3.10.egg/elasticsearch/connection/http_urllib3.py", line 277, in perform_request
self._raise_error(response.status, raw_data)
File "/home/jtaleric/dev/benchmark-comparison/demo/lib64/python3.10/site-packages/elasticsearch-7.13.4-py3.10.egg/elasticsearch/connection/base.py", line 330, in _raise_error
raise HTTP_EXCEPTIONS.get(status_code, TransportError)(
elasticsearch.exceptions.NotFoundError: NotFoundError(404, 'index_not_found_exception', 'no such index [k8s_cluster_info-metadata]', k8s_cluster_info-metadata, index_or_alias)
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in touchstone/databases/elasticsearch.py at get_metadata, then trace its call from touchstone/compare.py main. Reproduce the missing-index case and verify it emits a warning instead of the exception, continues processing, and does not dump the traceback; the issue mentions no test file to run.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.