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

Single-compute readworker timeout should go into exceptionQue, behind… #101

Merged
Merged
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
48 changes: 27 additions & 21 deletions rios/applier.py
Original file line number Diff line number Diff line change
Expand Up @@ -827,27 +827,33 @@ def apply_singleCompute(userFunction, infiles, outfiles, otherArgs,
blockDefn, allInfo, gdalObjCache, controls,
tmpfileMgr, rasterizeMgr)
else:
with timings.interval('pop_readbuffer'):
(blockDefn, inputs) = inBlockBuffer.popNextBlock()

readerInfo = makeReaderInfo(workinggrid, blockDefn, controls,
infiles, inputs, allInfo)

outputs = BlockAssociations()
userArgs = (readerInfo, inputs, outputs)
if otherArgs is not None:
userArgs += (otherArgs,)

with timings.interval('userfunction'):
userFunction(*userArgs)

if outBlockBuffer is None:
with timings.interval('writing'):
writeBlock(gdalOutObjCache, blockDefn, outfiles, outputs,
controls, workinggrid)
else:
with timings.interval('insert_computebuffer'):
outBlockBuffer.insertCompleteBlock(blockDefn, outputs)
try:
with timings.interval('pop_readbuffer'):
(blockDefn, inputs) = inBlockBuffer.popNextBlock()
except Exception as e:
workerErr = WorkerErrorRecord(e, 'main')
exceptionQue.put(workerErr)
blockDefn = inputs = None

if inputs is not None:
readerInfo = makeReaderInfo(workinggrid, blockDefn, controls,
infiles, inputs, allInfo)

outputs = BlockAssociations()
userArgs = (readerInfo, inputs, outputs)
if otherArgs is not None:
userArgs += (otherArgs,)

with timings.interval('userfunction'):
userFunction(*userArgs)

if outBlockBuffer is None:
with timings.interval('writing'):
writeBlock(gdalOutObjCache, blockDefn, outfiles,
outputs, controls, workinggrid)
else:
with timings.interval('insert_computebuffer'):
outBlockBuffer.insertCompleteBlock(blockDefn, outputs)

blockNdx += 1

Expand Down
Loading