This is an automated email from the ASF dual-hosted git repository.
zyxxoo pushed a commit to branch refactor/rust-rewrite-design
in repository https://gitbox.apache.org/repos/asf/hugegraph.git
The following commit(s) were added to refs/heads/refactor/rust-rewrite-design
by this push:
new 97775a6df fix(oracle): bypass proxy for local history capture
97775a6df is described below
commit 97775a6df8fae3fb5f161efb94a9d3003f911767
Author: vaughn <[email protected]>
AuthorDate: Sun Sep 13 16:02:28 2026 +0800
fix(oracle): bypass proxy for local history capture
---
tools/raft-linearizability/capture_history.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tools/raft-linearizability/capture_history.py
b/tools/raft-linearizability/capture_history.py
index 32d8879fa..7e477b645 100755
--- a/tools/raft-linearizability/capture_history.py
+++ b/tools/raft-linearizability/capture_history.py
@@ -2,12 +2,14 @@
"""Capture a small register history from an HTTP endpoint."""
import argparse, json, time, urllib.request
+OPENER = urllib.request.build_opener(urllib.request.ProxyHandler({}))
+
def capture(url, value):
ops=[]
def call(op, value=None):
ident=f'op-{len(ops)+1}'; start=time.monotonic_ns()
req=urllib.request.Request(url, method='GET' if op=='read' else
'POST', data=None if op=='read' else json.dumps({'value':value}).encode(),
headers={'Content-Type':'application/json'})
- with urllib.request.urlopen(req, timeout=10) as r:
body=r.read().decode(); observed=value if op=='write' else
json.loads(body).get('value')
+ with OPENER.open(req, timeout=10) as r: body=r.read().decode();
observed=value if op=='write' else json.loads(body).get('value')
ops.append({'id':ident,'op':op,'value':observed,'start':start,'end':time.monotonic_ns()})
call('write', value); call('read'); return ops