jumaffre / cimetrics

Track your metrics in GitHub PR to avoid unwanted regressions
MIT License
16 stars 2 forks source link

Pin `PyMongo` #122

Closed jumaffre closed 2 years ago

jumaffre commented 2 years ago

PyMongo update to 4.0 triggers the following exception when running python app/main.py:

Traceback (most recent call last):
  File "app/main.py", line 32, in <module>
    m.put("New metric (U)", results["new_metric"])
  File "/usr/lib/python3.8/contextlib.py", line 120, in __exit__
    next(self.gen)
  File "/home/jumaffre/git/cimetrics/cimetrics/upload.py", line 79, in metrics
    m.publish()
  File "/home/jumaffre/git/cimetrics/cimetrics/upload.py", line 72, in publish
    coll.insert_one(doc)
  File "/home/jumaffre/git/cimetrics/env/lib/python3.8/site-packages/pymongo/collection.py", line 524, in insert_one
    self._insert_one(
  File "/home/jumaffre/git/cimetrics/env/lib/python3.8/site-packages/pymongo/collection.py", line 474, in _insert_one
    self.__database.client._retryable_write(
  File "/home/jumaffre/git/cimetrics/env/lib/python3.8/site-packages/pymongo/mongo_client.py", line 1340, in _retryable_write
    return self._retry_with_session(retryable, func, s, None)
  File "/home/jumaffre/git/cimetrics/env/lib/python3.8/site-packages/pymongo/mongo_client.py", line 1229, in _retry_with_session
    return self._retry_internal(retryable, func, session, bulk)
  File "/home/jumaffre/git/cimetrics/env/lib/python3.8/site-packages/pymongo/mongo_client.py", line 1249, in _retry_internal
    server = self._select_server(writable_server_selector, session)
  File "/home/jumaffre/git/cimetrics/env/lib/python3.8/site-packages/pymongo/mongo_client.py", line 1137, in _select_server
    server = topology.select_server(server_selector)
  File "/home/jumaffre/git/cimetrics/env/lib/python3.8/site-packages/pymongo/topology.py", line 242, in select_server
    servers = self.select_servers(
  File "/home/jumaffre/git/cimetrics/env/lib/python3.8/site-packages/pymongo/topology.py", line 200, in select_servers
    server_descriptions = self._select_servers_loop(
  File "/home/jumaffre/git/cimetrics/env/lib/python3.8/site-packages/pymongo/topology.py", line 234, in _select_servers_loop
    self._description.check_compatible()
  File "/home/jumaffre/git/cimetrics/env/lib/python3.8/site-packages/pymongo/topology_description.py", line 130, in check_compatible
    raise ConfigurationError(self._incompatible_err)
pymongo.errors.ConfigurationError: Server at cdb-ms-prod-eastus1-fd3.documents.azure.com:10255 reports wire version 2, but this version of PyMongo requires at least 6 (MongoDB 3.6)
cimetrics commented 2 years ago

pin_pymongo@724 aka 20211130.2 vs main ewma over 17 builds from 637 to 721

Click to see table | build_id | build_number | Throughput (tx/s) ^ | Latency (ms) | Peak working set size (GB) | Accuracy (%) ^ | Error rate (%) | Memory fragmentation (%) | CPU usage (%) | New metric (U) | |-----------:|:---------------|----------------------:|---------------:|-----------------------------:|-----------------:|-----------------:|---------------------------:|----------------:|-----------------:| | 637 | 20210205.1 | 48261 | 10 | 46 | 0.68 | 0.05 | 0.02 | 0.28 | 189 | | 638 | 20210205.2 | 50232 | 11 | 51 | 0.69 | 0.04 | 0.019 | 0.32 | 101 | | 646 | 20210205.10 | 47148 | 10 | 55 | 0.72 | 0.05 | 0.02 | 0.31 | 129 | | 647 | 20210205.11 | 49154 | 10 | 49 | 0.68 | 0.05 | 0.022 | 0.32 | 197 | | 652 | 20210205.16 | 47145 | 9 | 52 | 0.69 | 0.06 | 0.02 | 0.3 | 100 | | 653 | 20210205.17 | 50877 | 10 | 55 | 0.7 | 0.04 | 0.022 | 0.28 | 100 | | 655 | 20210326.1 | 46562 | 10 | 51 | 0.69 | 0.06 | 0.021 | 0.31 | 155 | | 658 | 20210326.4 | 50718 | 9 | 53 | 0.68 | 0.05 | 0.021 | 0.29 | 128 | | 660 | 20210326.6 | 46897 | 9 | 48 | 0.73 | 0.05 | 0.022 | 0.28 | 133 | | 664 | 20210401.3 | 49393 | 11 | 53 | 0.73 | 0.05 | 0.019 | 0.29 | 188 | | 669 | 20210401.8 | 51450 | 9 | 54 | 0.72 | 0.06 | 0.022 | 0.29 | 191 | | 686 | 20210402.15 | 47190 | 9 | 45 | 0.69 | 0.04 | 0.02 | 0.29 | 190 | | 687 | 20210402.16 | 51510 | 9 | 50 | 0.71 | 0.06 | 0.021 | 0.28 | 192 | | 704 | 20210412.4 | 46827 | 10 | 49 | 0.73 | 0.04 | 0.018 | 0.31 | 195 | | 705 | 20210412.5 | 51577 | 11 | 55 | 0.71 | 0.05 | 0.022 | 0.29 | 172 | | 719 | 20211117.12 | 47049 | 10 | 52 | 0.73 | 0.05 | 0.022 | 0.28 | 107 | | 721 | 20211117.14 | 47179 | 9 | 45 | 0.69 | 0.05 | 0.018 | 0.3 | 113 |

images

jumaffre commented 2 years ago

Abandoning this as the real fix was to upgrade the CosmosDB instance to 4.0.