Skip to content

[Bug]: Fix flaky EventHub publish test, prevent nil-client crash, and optimize S3 ReadDir memory overhead #3493

Description

@Manidwiptam

🐛 Bug Overview

This report details two critical issues regarding runtime safety and resource optimization within the framework:

  1. EventHub: A missing initialization guard in Publish allowed execution to proceed with a nil producer client, introducing structural flakiness. Concurrently, the associated failure test was unstable and explicitly skipped.
  2. S3 File System: The ReadDir implementation relied on a wide prefix-only lookup, fetching metadata for all deeply nested objects. This behavior caused unnecessary memory allocation overhead in dense directory structures.

🕹️ Steps to Reproduce

1. EventHub Uninitialized State Execution

Creating an EventHub client and attempting a write sequence without an explicit connection hook:

// Configuration is valid, but Connect() lifecycle step is omitted
client := eventhub.New(cfg) 
err := client.Publish(context.Background(), cfg.EventhubName, []byte("msg"))

Metadata

Metadata

Assignees

No one assigned

    Labels

    triageThe issue needs triaging.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions