Feat/v0.7.0 error handling#10
Merged
Merged
Conversation
Add a richer error-handling API to both thread pools. LastError is unchanged and fully backward compatible. Core (implemented once in TThreadPoolBase, inherited by both pools): - Errors: TStringArray — every captured task error message, oldest first - ErrorCount: Integer - OnError: TThreadPoolErrorEvent — optional callback fired on a worker thread per failed task; invoked outside the lock to avoid deadlocks - ClearErrors — clears the collection and LastError - MAX_STORED_ERRORS (1000) caps the collection; oldest dropped beyond it - Removed the now-redundant per-pool FErrorLock; the base class serializes error capture Tests (43 total, +8): - ThreadPool.Simple.Tests: collection-captures-all, OnError fires per failure, ClearErrors resets, cap enforced, LastError back-compat - ThreadPool.ProducerConsumer.Tests: matching coverage on the second pool Examples: - SimpleErrorHandlingBasic — the easy way: poll Errors/ErrorCount/LastError after WaitForAll; no callback, class, or locking - SimpleErrorHandling — advanced: OnError with a thread-safe handler Docs / housekeeping: - README, both API docs, CHANGELOG, docs/release-notes-v0.7.0.md updated; corrected an inaccurate "error messages include thread IDs" claim (raw messages) - Bump version to 0.7.0 (README badge, package .lpk) - Planned/In Progress now points to the 0.8.0 performance milestone - .gitignore: ignore lazbuild's local packagefiles.xml cache
This is per-developer Claude Code config that was accidentally committed. Add it to .gitignore and remove it from tracking (local copy is kept).
Add Lazarus/FPC projects demonstrating v0.7.0 error handling for parallel file hashing and URL fetching. Move v0.5.0 release notes into docs.
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.
What does this PR do?
Makes v0.7.0 official.
This release adds richer task error handling to both thread pools via the shared
TThreadPoolBaseimplementation:Errors,ErrorCount,ClearErrors, andOnError.LastErrorbackward-compatible as the most recent task error.MAX_STORED_ERRORS = 1000.LastErrorcompatibility.OnErrorhandling, parallel file hashing, and parallel URL fetching.Local verification completed:
ParallelUrlFetcherexercised its runtime error path due local OpenSSL/network issues and exited cleanly.Related issue
N/A
Type of change
Checklist
lazbuild tests/TestRunner.lpithen runTestRunner)CHANGELOG.mddocs/if behavior or API changed{$mode objfpc}{$H+}{$J-}and filenames match unit casing