Repository navigation
benchmark.py: refuse a worker interface with a NULL work or work_response (#41) - #97
Merged
Merged
Conversation
…onse (#41) The adapter called both through ctypes without a check, and a NULL function pointer kills the process. worker_interface now raises WorkerInterfaceError, whose message starts with hosting.worker.nonconforming, before anything is called; the worker loop reports it as the plugin's error like any probe failure. end_run stays optional. Tests build real interface tables with a NULL field in a child process.
…the probe's refusal (#41) The Python refusal is now a code on the TypeScript side too. HOSTING_CODE.workerNonconforming; the measurement vocabulary's worker-nonconforming term, chosen by probeReasonCode for any prober text carrying the code (so it is never the generic probe-error); and hostingLatencyReasons rates a latency refused that way unsuitable under that code instead of unknown/latency unmeasured. Tests by code in hosting-suitability and probe-json, and one holding benchmark.py's constant equal to the TS code.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #41.
The Python worker adapter called the plugin's work_response (and work) through ctypes with no NULL check; a NULL function pointer kills the process. worker_interface now raises WorkerInterfaceError (message starting with
hosting.worker.nonconforming, naming the field) before anything is called, and the worker loop reports it as that plugin's error like any probe failure, so the batch goes on. end_run is optional in the LV2 worker spec and stays so.Tests (TestWorkerInterfaceNonconforming): a real ctypes interface table with one field NULL, run in a child process so a crash fails the test instead of the run. Before the change both NULL cases came back as a normal interface; with the check they are refused; a complete table and one without end_run still work. All of tools passes (177).
Question: the code is a string in benchmark.py only. The TypeScript HOSTING_CODE table has no worker code, and the Python error text is not mapped to a verdict reason there (a failed probe reads as unmeasured). Whether to mint hosting.worker.nonconforming in src/hosting-codes.ts and map it needs a ruling.