Migration Guide¶
This page collects behavior changes that may require updates when upgrading Silkworm. Read every section between your installed version and the target version.
Upgrading to 0.14¶
Destination pipelines now use bulk client calls or coalesced writes instead of repeated single-row ingestion when processing a batch.
Engine batching is opt-in with
item_batch_size; the default of1preserves existingemit()timing. Partial batches flush afteritem_batch_wait.CallbackPipelineaccepts an optionalbatch_callbackfor ordered, one-to-one batch transformations.Backend-reported partial batch failures raise
BatchPipelineErrorwhen the client exposes per-item results.
With batching disabled, every await spider.emit(item) still sends one item
through the configured pipeline chain immediately. With batching enabled,
emit() queues with bounded backpressure and pending results are drained before
the callback completes.
Upgrading to 0.13¶
Every built-in pipeline now provides
process_items(items, spider)for explicit batch processing. The default preserves the order, transformations, and errors of repeatedprocess_itemcalls.IggyPipelineuses Apache Iggy’s native producer batch operation. Install it withpip install "silkworm-rs[iggy]"on Python 3.13.BatchItemPipelineis available as a public protocol for batch-capable custom pipelines. Existing custom pipelines implementing onlyItemPipelineremain valid.
Upgrading to 0.12¶
Runners and
Engine.run()return aCrawlResultinstead ofNone.The default deduplication key is the request fingerprint—method, canonical URL with
params, and body—instead of the raw URL. Equivalent query ordering is deduplicated, while POST requests with different bodies remain distinct.items_scrapedcounts items that passed every pipeline. Pipelines can raiseDropItemto discard an item, which incrementsitems_dropped.Responses preserve the exact downloaded bytes. Bodies larger than
max_response_size_bytes—50 MB by default—raiseResponseTooLargeError.Timeouts and connection failures raise
HttpTimeoutErrorandHttpConnectionError, both subclasses ofHttpError.RetryMiddlewareretries them.Requests store link depth in
request.meta["depth"]. Built-in counter names, such asretries, are reserved inSpider.stats_payload.Synchronous runners stop gracefully on SIGINT and SIGTERM. Pass
handle_signals=Falseto opt out.Requests time out after 60 seconds by default. Pass
request_timeout=Noneto restore unlimited waits.
See Production Crawling for failure policies and stop behavior, and Engine and HTTP Client for request semantics.
Upgrading from 0.10 to 0.11¶
Silkworm 0.11 replaced yielded and returned callback outputs with push-style
emit and follow calls. Callbacks, errbacks, and start_requests() are async
functions returning None.
Before 0.11 |
0.11 and newer |
|---|---|
|
|
|
|
|
|
return a list of outputs |
await each |
Legacy generator callbacks fail with a SpiderError containing a migration
hint. See Reporting Results
for callback lifetime and backpressure rules.