Skip to content

Potential double-await on join_all may cause runtime panic in server shutdown #58

@coderabbitai

Description

@coderabbitai

Description

A potential runtime panic has been identified in the server shutdown logic where the join_all future is polled twice:

  1. First, it's polled to completion in tokio::select! with _ = &mut join_all => {}
  2. Then it's awaited again in the subsequent for loop with for res in join_all.await

Problem

The JoinAll future is not Fused, which means polling it after it has already returned Ready can cause a panic (related to futures::stream::FuturesUnordered internals).

Location

  • File: src/server.rs
  • Lines: 305-317

Context

This issue was identified during code review and needs to be addressed to prevent potential runtime panics during server shutdown.

References

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions