<!-- XE-13312 · [net/gossip.go] H11: peerPing() tidak handle timeout — goroutine leak · testnet -->
*Markdown view of <https://bounty.xe.network/XE-13312>. The page is the record; this is the same page for reading.*

XE-13312 · Bounty

# \[net/gossip.go\] H11: peerPing() tidak handle timeout — goroutine leak

Closed · invalid
—
[xe#457](https://github.com/xeprotocol/xe/issues/457)
filed 2026-11-12 02:55 UTC
by wahyu20260100233-ops

Verdict
:   Invalid

Tier
:   —

Claimed
:   —

Area
:   P2P / sync

Duplicate of
:   —

Tracked
:   —

Updated
:   2026-11-20 00:51 UTC

Told
:   2026-11-20 00:50 UTC

### Patches

None linked.

### History

- [559436](https://bounty.xe.network/log/559436) 2026-11-20 00:50 UTC reply.mirrored
- [558496](https://bounty.xe.network/log/558496) 2026-11-20 00:49 UTC reply.sent
- [554811](https://bounty.xe.network/log/554811) 2026-11-20 00:37 UTC github.state\_pushed
- [554795](https://bounty.xe.network/log/554795) 2026-11-20 00:37 UTC github.labels
- [553371](https://bounty.xe.network/log/553371) 2026-11-20 00:33 UTC proposal.adopted
- [553194](https://bounty.xe.network/log/553194) 2026-11-20 00:33 UTC proposal.adopted
- [553193](https://bounty.xe.network/log/553193) 2026-11-20 00:33 UTC ticket.status new → closed
- [552864](https://bounty.xe.network/log/552864) 2026-11-20 00:33 UTC proposal.adopted
- [552863](https://bounty.xe.network/log/552863) 2026-11-20 00:33 UTC ticket.facts area
- [552862](https://bounty.xe.network/log/552862) 2026-11-20 00:33 UTC proposal.adopted
- [552861](https://bounty.xe.network/log/552861) 2026-11-20 00:33 UTC ticket.facts
- [550390](https://bounty.xe.network/log/550390) 2026-11-20 00:29 UTC note.added

[Full history](https://bounty.xe.network/log?ref=XE-13312) · [JSON](https://bounty.xe.network/v1/tickets/XE-13312) · [markdown](https://bounty.xe.network/XE-13312.md)

### Report

## Ringkasan

Kalau peer tidak merespon dalam waktu yang ditentukan, goroutine tetap berjalan. Tidak ada timeout mechanism.

## Lokasi

- File: `net/gossip.go`
- Lines: 281-300

## Kode

```
func (g *Gossip) peerPing(pid peer.ID) {
    ...
    stream, err := g.host.NewStream(g.ctx, pid, GossipProtocolID)
    if err != nil {
        logging.Debugf("gossip: failed to open stream to %s: %v", pid, err)
        return
    }
    defer stream.Close()
    ...
}
```

## Impact

Goroutine leak kalau peer tidak merespon. Resource exhaustion.

## Suggested Fix

```
func (g *Gossip) peerPing(ctx context.Context, pid peer.ID) {
    ...
    stream, err := g.host.NewStream(ctx, pid, GossipProtocolID)
    if err != nil {
        logging.Debugf("gossip: failed to open stream to %s: %v", pid, err)
        return
    }
    defer stream.Close()

    // tambah timeout
    select {
    case <-ctx.Done():
        return
    case <-time.After(5 * time.Second):
        return
    }
}
```

### Thread

**XE desk**team2026-11-20 00:50 UTCgithub

Thanks for the report. We read it against the code and could not confirm a bug in what it describes.

This report is closed as invalid. If we have missed something, file a new report that links
https://bounty.xe.network/XE-13312 and says what; it is read like any other.
