Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix scan timeout on Windows #355

Merged
merged 2 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions hsds/async_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
from .util.arrayUtil import getNumElements, bytesToArray
from .util.dsetUtil import getHyperslabSelection, getFilterOps, getChunkDims, getFilters
from .util.dsetUtil import getDatasetLayoutClass, getDatasetLayout, getShapeDims
from .util.timeUtil import getNow
from .util.storUtil import getStorKeys, putStorJSONObj, getStorJSONObj
from .util.storUtil import deleteStorObj, getStorBytes, isStorObj
from . import hsds_logger as log
from . import config
import time

# List all keys under given root and optionally update info.json
# Note: only works with schema v2 domains!
Expand Down Expand Up @@ -382,7 +382,7 @@ async def scanRoot(app, rootid, update=False, bucket=None):
results["logical_bytes"] = 0
results["checksums"] = {} # map of objid to checksums
results["bucket"] = bucket
results["scan_start"] = getNow(app)
results["scan_start"] = time.time()

app["scanRoot_results"] = results
app["scanRoot_keyset"] = set()
Expand Down Expand Up @@ -437,7 +437,7 @@ async def scanRoot(app, rootid, update=False, bucket=None):
# free up memory used by the checksums
del results["checksums"]

results["scan_complete"] = getNow(app)
results["scan_complete"] = time.time()

if update:
# write .info object back to S3
Expand Down
2 changes: 2 additions & 0 deletions tests/integ/value_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import numpy as np
import helper
import config
import time


class ValueTest(unittest.TestCase):
Expand Down Expand Up @@ -47,6 +48,7 @@ def checkVerbose(self, dset_id, headers=None, expected=None):
rsp = self.session.put(req, params=params, headers=headers)
if (rsp.status_code == 503):
# Retry
time.sleep(3)
continue
# should get a NO_CONTENT code
self.assertEqual(rsp.status_code, 204)
Expand Down
Loading