Repository navigation
fix(blobExec): exclude a blob on a tokenizer error, never keep its source - #106
Merged
Merged
Conversation
Before this change, a tokenizer that exited non-zero with a status other than 33 or a signal status kept the original blob. Thus the raw source went into the token tree and the blob map, and no EXCLUDED line named the blob. Examples: the Rust tokenizer exits 1 on a file that is not UTF-8, and tokenBySha.pl exits non-zero when it dies. Now, without --abort-on-error, a non-zero exit excludes the blob. The EXCLUDED failed blob line gives reason=tokenizer-error, and the done line counts the blob in blobsTokenizerFailed. With --abort-on-error, the run stops with exit 2, as before. The new reason keeps the parser-crash count for srcML crashes only. No script reads the reason values or the parser-crash count, so no consumer changes.
DATASET.md lists reason=tokenizer-error and blobsTokenizerFailed with the other failed-blob exclusions. WORKER_PROTOCOL.md said that a worker that stops in a request gives a tokenizer error. The code reports a timeout, so the text now says that.
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.
Stacked on #105. Base:
fix/mojibake-gate. Merge #105 first.Problem
A tokenizer can exit non-zero with a status that is not 33 (parser
crash) and not above 128 (signal). Without
--abort-on-error, blobExecthen kept the original blob. The raw source went into the token tree
and the blob map, and no
EXCLUDEDline named the blob. Examples:.rsfile that is not UTF-8.tokenBySha.plandtokenize.plusedie.dieexits with errno or 255.The bug is on the per-blob path and on the
--tokenizer-workerpath.Change
--abort-on-error, a non-zero exit excludes the blob. TheEXCLUDED failed blobline givesreason=tokenizer-error.BlobExec.runhas a newonTokenizerErrorcallback. The walker countsthese blobs in
blobsTokenizerFailed. TheblobExec done:line and thesummary of failed blobs show the count.
--abort-on-error, the run stops with exit 2, as before.README.mdandblobExec/README.orgdescribe the newbehaviour.
The change uses a new reason, not
parser-crash. A test asserts thatexit 7 does not increment the parser-crash count. The parser-crash
warning says that srcML died, and that is wrong for a tokenizer error. No script reads the reason values, and
shard_merge.pyignores unknown keys on the done line. Thus no consumerchanges.
Not changed
their reasons.
Docs
generate_dataset/DATASET.mdlistsreason=tokenizer-errorandblobsTokenizerFailed.WORKER_PROTOCOL.mdsaid that a worker that stops in a request gives a tokenizer error. The code reports a timeout, so the text now says that.Tests
BlobExecSpec: a tokenizer that exits 1 with output is excluded. OnlyonTokenizerErrorfires.TokenizerWorkerPoolSpec: a worker answer with exit 1 is excluded.With
--abort-on-error, it aborts.FailedBlobSpec: a blob that exits 1 is absent from the tree and fromthe blob map, in serial, pipeline and pipeline-trees mode.
The 5 new tests fail on master. All CI suites pass: sbt 184 tests, prove
239, pytest 74, the shell suites, the worker test, the srcml2token and
Rust tests, and the legacy modules.