Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -1380,7 +1380,13 @@ func (c *Conn) CreateProtectedEphemeralSequentialCtx(ctx context.Context, path s
case ErrConnectionClosed:
children, _, err := c.ChildrenCtx(ctx, rootPath)
if err != nil {
return "", err
// Return the path with GUID for error handling
//
// If the connection is closed, it may re-establish, and
// the session might still be active, so we should
// return the base path for clients to recover from that
// situation.
return protectedPath, err
}
for _, p := range children {
parts := strings.Split(p, "/")
Expand All @@ -1393,7 +1399,7 @@ func (c *Conn) CreateProtectedEphemeralSequentialCtx(ctx context.Context, path s
case nil:
return newPath, nil
default:
return "", err
return protectedPath, err
}
}
return "", err
Expand Down