# Potential Bug - Error propagation for batch write during checkContext

**URL:** <https://forum.weaviate.io/t/potential-bug-error-propagation-for-batch-write-during-checkcontext/22280>\
**Category:** Support\
**Tags:** bug\
**Created:** [March 23, 2026, 7:28am UTC](https://forum.weaviate.io/t/potential-bug-error-propagation-for-batch-write-during-checkcontext/22280 "2026-03-23T07:28:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![arindombora21](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/arindombora21/32/7893_2.png) [@arindombora21](https://forum.weaviate.io/u/arindombora21)\
**Post date:** [March 23, 2026, 7:28am UTC](https://forum.weaviate.io/t/potential-bug-error-propagation-for-batch-write-during-checkcontext/22280/1 "2026-03-23T07:28:34Z")

</div>

### Description

PFA the description of the entire issue

> <https://github.com/weaviate/weaviate/issues/10805>
>
> \### How to reproduce this bug?
> 
> checkContext function has inverted logic causing… silent data loss during batch writes under timeout
> 
> Component
> Module: adapters/repos/db
> File: shard\_write\_batch\_objects.go
> Function: checkContext() (lines 441-456)
> 
> \### What is the expected behavior?
> 
> \`\`\`
> func (ob \*objectsBatcher) checkContext(ctx context.Context) bool {
> if err := ctx.Err(); err != nil {
> for i, objErr := range ob.errs {
> if objErr != nil {
> // already has an error, ignore
> continue
> }
> ob.errs\[i\] = errors.Wrapf(err,
> "inverted indexing complete, about to start vector indexing")
> }
> return false
> }
> return true
> }
> \`\`\`
> 
> This way object without errors but inactive context would also get captured.
> 
> \### What is the actual behavior?
> 
> \`\`\`
> func (ob \*objectsBatcher) checkContext(ctx context.Context) bool {
> if err := ctx.Err(); err != nil {
> for i, err := range ob.errs {
> if err == nil {
> // already has an error, ignore
> continue
> }
> ob.errs\[i\] = errors.Wrapf(err,
> "inverted indexing complete, about to start vector indexing")
> }
> return false
> }
> return true
> }
> \`\`\`
> 
> Here, when context has error, objects which did not have error are getting ignored instead of the ones with error(evident from the comment). This way if object had no error but context had an error, those errors never propagate back to the client.
> Also, the context error seems to be shadowed by the loop variable.
> 
> \### Supporting information
> 
> \_No response\_
> 
> \### Server Version
> 
> 1.32.5
> 
> \### Weaviate Setup
> 
> Multi-Node Cluster
> 
> \### Nodes count
> 
> 3
> 
> \### Code of Conduct
> 
> \- \[x\] I have read and agree to the Weaviate's \[Contributor Guide\](https://weaviate.io/developers/contributor-guide) and \[Code of Conduct\](https://weaviate.io/service/code-of-conduct)

### Server Setup Information

- Weaviate Server Version:
- Deployment Method:
- Multi Node? Number of Running Nodes:
- Client Language and Version:
- Multitenancy?:

### Any additional Information

---

<div class="post-metadata">

**Author:** ![discourse\_ai\_spam](https://avatars.discourse-cdn.com/v4/letter/d/c68b51/32.png) [@discourse\_ai\_spam](https://forum.weaviate.io/u/discourse_ai_spam)\
**Post date:** [March 23, 2026, 7:28am UTC](https://forum.weaviate.io/t/potential-bug-error-propagation-for-batch-write-during-checkcontext/22280/2 "2026-03-23T07:28:37Z")

</div>



---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex027/uploads/weaviate/original/1X/1e4f79946085f797748d20c51e18000db67735b2.png) [@system](https://forum.weaviate.io/u/system)\
**Post date:** [March 23, 2026, 8:41pm UTC](https://forum.weaviate.io/t/potential-bug-error-propagation-for-batch-write-during-checkcontext/22280/3 "2026-03-23T20:41:34Z")

</div>



---

<div class="post-metadata">

**Author:** ![DudaNogueira](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/dudanogueira/32/7846_2.png) [@DudaNogueira](https://forum.weaviate.io/u/DudaNogueira)\
**Post date:** [March 23, 2026, 8:43pm UTC](https://forum.weaviate.io/t/potential-bug-error-propagation-for-batch-write-during-checkcontext/22280/4 "2026-03-23T20:43:05Z")

</div>

hi @arindombora21 !!

Thanks for reporting!
