Skip to content
Closed
Show file tree
Hide file tree
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
24 changes: 6 additions & 18 deletions .github/workflows/pika.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,24 +170,12 @@ jobs:

- name: Extreme Disk Cleanup
run: |

rm -rf /usr/local/share/* || true
rm -rf /usr/share/doc/* || true
rm -rf /usr/share/man/* || true
rm -rf /var/cache/* || true

find ${{ github.workspace }} -name "*.o" -type f -delete || true
find ${{ github.workspace }} -name "*.a" -type f -delete || true
find ${{ github.workspace }} -name "*.la" -type f -delete || true
find ${{ github.workspace }} -name "*.so" -type f -delete || true
find ${{ github.workspace }} -name "*.pyc" -type f -delete || true

rm -rf ${{ github.workspace }}/.git || true

rm -rf /__w/pikiwidb/pikiwidb/buildtrees 2>/dev/null || true
rm -rf /__w/pikiwidb/pikiwidb/deps 2>/dev/null || true
find /__w/pikiwidb/pikiwidb -type f \( -name "librocksdb.a" -o -name "libprotoc.a" -o -name "libprotobuf.a" \) -delete 2>/dev/null || true
find /__w/pikiwidb/pikiwidb -type f \( -name "*.o" -o -name "*.a" -o -name "*.la" -o -name "*.so" -o -name "*_test" \) ! -path "*/build/pika" -delete 2>/dev/null || true
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Fix path exclusion pattern to preserve entire build/pika subtree.

The exclusion pattern ! -path "*/build/pika" only excludes paths that exactly match */build/pika, not files within that directory. Files like /__w/pikiwidb/pikiwidb/build/pika/bin/pika.a would still be deleted because their full path doesn't match the pattern.

Extend the pattern to exclude the entire subtree.

- find /__w/pikiwidb/pikiwidb -type f \( -name "*.o" -o -name "*.a" -o -name "*.la" -o -name "*.so" -o -name "*_test" \) ! -path "*/build/pika" -delete 2>/dev/null || true
+ find /__w/pikiwidb/pikiwidb -type f \( -name "*.o" -o -name "*.a" -o -name "*.la" -o -name "*.so" -o -name "*_test" \) ! -path "*/build/pika/*" -delete 2>/dev/null || true
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
find /__w/pikiwidb/pikiwidb -type f \( -name "*.o" -o -name "*.a" -o -name "*.la" -o -name "*.so" -o -name "*_test" \) ! -path "*/build/pika" -delete 2>/dev/null || true
find /__w/pikiwidb/pikiwidb -type f \( -name "*.o" -o -name "*.a" -o -name "*.la" -o -name "*.so" -o -name "*_test" \) ! -path "*/build/pika/*" -delete 2>/dev/null || true
🤖 Prompt for AI Agents
.github/workflows/pika.yml around line 176: the find command currently uses !
-path "*/build/pika" which only protects the directory itself but not files
under it; update the exclusion to cover the entire subtree (for example change
the pattern to ! -path "*/build/pika/*" or use -path "*/build/pika" -prune) so
files inside build/pika (and its subdirs) are not deleted.

rm -rf /__w/pikiwidb/pikiwidb/.git 2>/dev/null || true
df -h

echo "Largest directories:"
du -h --max-depth=2 / 2>/dev/null | sort -hr | head -20

- name: Create Log Directories
run: |
Expand Down Expand Up @@ -318,4 +306,4 @@ jobs:
file: ./ci/Dockerfile
push: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
labels: ${{ steps.meta.outputs.labels }}
57 changes: 57 additions & 0 deletions tests/integration/network_stability_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
package pika_integration

import (
"net"
. "github.com/bsm/ginkgo/v2"
. "github.com/bsm/gomega"
)

var _ = Describe("Telnet", func() {
Describe("core dump fix", func() {
It("should handle empty commands without crashing (telnet core dump fix)", func() {
conn, err := net.Dial("tcp", SINGLEADDR)
Expect(err).NotTo(HaveOccurred())
defer conn.Close()

_, err = conn.Write([]byte("\n"))
Expect(err).NotTo(HaveOccurred())

_, err = conn.Write([]byte("*1\r\n$4\r\nPING\r\n"))
Expect(err).NotTo(HaveOccurred())

buf := make([]byte, 1024)
n, err := conn.Read(buf)
Expect(err).NotTo(HaveOccurred())
response := string(buf[:n])
Expect(response).To(ContainSubstring("+PONG"))

_, err = conn.Write([]byte("*2\r\n$4\r\nECHO\r\n$4\r\nTEST\r\n"))
Expect(err).NotTo(HaveOccurred())

n, err = conn.Read(buf)
Expect(err).NotTo(HaveOccurred())
response = string(buf[:n])
Expect(response).To(ContainSubstring("$4\r\nTEST"))
})

It("should handle multiple empty commands without crashing", func() {
conn, err := net.Dial("tcp", SINGLEADDR)
Expect(err).NotTo(HaveOccurred())
defer conn.Close()

for i := 0; i < 5; i++ {
_, err = conn.Write([]byte("\r\n"))
Expect(err).NotTo(HaveOccurred())
}

_, err = conn.Write([]byte("*1\r\n$4\r\nPING\r\n"))
Expect(err).NotTo(HaveOccurred())

buf := make([]byte, 1024)
n, err := conn.Read(buf)
Expect(err).NotTo(HaveOccurred())
response := string(buf[:n])
Expect(response).To(ContainSubstring("+PONG"))
})
})
})
47 changes: 47 additions & 0 deletions tests/integration/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,31 @@ var _ = Describe("Server", func() {
Expect(configRewrite.Err()).NotTo(HaveOccurred())
Expect(configRewrite.Val()).To(Equal("OK"))
})

// Test for cache-value-item-max-size & max-key-size-in-cache
It("should handle cache size configurations correctly", func() {
configGet := client.ConfigGet(ctx, "cache-value-item-max-size")
Expect(configGet.Err()).NotTo(HaveOccurred())
Expect(configGet.Val()).To(HaveKey("cache-value-item-max-size"))

configGet2 := client.ConfigGet(ctx, "max-key-size-in-cache")
Expect(configGet2.Err()).NotTo(HaveOccurred())
Expect(configGet2.Val()).To(HaveKey("max-key-size-in-cache"))

configSet1 := client.ConfigSet(ctx, "cache-value-item-max-size", "1024")
Expect(configSet1.Err()).NotTo(HaveOccurred())
Expect(configSet1.Val()).To(Equal("OK"))

configSet2 := client.ConfigSet(ctx, "max-key-size-in-cache", "1048576")
Expect(configSet2.Err()).NotTo(HaveOccurred())
Expect(configSet2.Val()).To(Equal("OK"))
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing whitespace detected. Remove trailing whitespace to maintain code cleanliness and consistency with Go formatting standards.

Copilot uses AI. Check for mistakes.

configGet3 := client.ConfigGet(ctx, "cache-value-item-max-size")
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing error check before accessing result. The error should be checked with Expect(configGet3.Err()).NotTo(HaveOccurred()) before accessing configGet3.Val() to prevent potential panics if the ConfigGet operation fails.

Suggested change
configGet3 := client.ConfigGet(ctx, "cache-value-item-max-size")
configGet3 := client.ConfigGet(ctx, "cache-value-item-max-size")
Expect(configGet3.Err()).NotTo(HaveOccurred())

Copilot uses AI. Check for mistakes.
Expect(configGet3.Val()["cache-value-item-max-size"]).To(Equal("1024"))

Comment on lines +447 to +458
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing whitespace detected. Remove trailing whitespace to maintain code cleanliness and consistency with Go formatting standards.

Suggested change
configSet1 := client.ConfigSet(ctx, "cache-value-item-max-size", "1024")
Expect(configSet1.Err()).NotTo(HaveOccurred())
Expect(configSet1.Val()).To(Equal("OK"))
configSet2 := client.ConfigSet(ctx, "max-key-size-in-cache", "1048576")
Expect(configSet2.Err()).NotTo(HaveOccurred())
Expect(configSet2.Val()).To(Equal("OK"))
configGet3 := client.ConfigGet(ctx, "cache-value-item-max-size")
Expect(configGet3.Val()["cache-value-item-max-size"]).To(Equal("1024"))
configSet1 := client.ConfigSet(ctx, "cache-value-item-max-size", "1024")
Expect(configSet1.Err()).NotTo(HaveOccurred())
Expect(configSet1.Val()).To(Equal("OK"))
configSet2 := client.ConfigSet(ctx, "max-key-size-in-cache", "1048576")
Expect(configSet2.Err()).NotTo(HaveOccurred())
Expect(configSet2.Val()).To(Equal("OK"))
configGet3 := client.ConfigGet(ctx, "cache-value-item-max-size")
Expect(configGet3.Val()["cache-value-item-max-size"]).To(Equal("1024"))

Copilot uses AI. Check for mistakes.
Comment on lines +443 to +458
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing whitespace detected. Remove trailing whitespace to maintain code cleanliness and consistency with Go formatting standards.

Suggested change
configGet2 := client.ConfigGet(ctx, "max-key-size-in-cache")
Expect(configGet2.Err()).NotTo(HaveOccurred())
Expect(configGet2.Val()).To(HaveKey("max-key-size-in-cache"))
configSet1 := client.ConfigSet(ctx, "cache-value-item-max-size", "1024")
Expect(configSet1.Err()).NotTo(HaveOccurred())
Expect(configSet1.Val()).To(Equal("OK"))
configSet2 := client.ConfigSet(ctx, "max-key-size-in-cache", "1048576")
Expect(configSet2.Err()).NotTo(HaveOccurred())
Expect(configSet2.Val()).To(Equal("OK"))
configGet3 := client.ConfigGet(ctx, "cache-value-item-max-size")
Expect(configGet3.Val()["cache-value-item-max-size"]).To(Equal("1024"))
configGet2 := client.ConfigGet(ctx, "max-key-size-in-cache")
Expect(configGet2.Err()).NotTo(HaveOccurred())
Expect(configGet2.Val()).To(HaveKey("max-key-size-in-cache"))
configSet1 := client.ConfigSet(ctx, "cache-value-item-max-size", "1024")
Expect(configSet1.Err()).NotTo(HaveOccurred())
Expect(configSet1.Val()).To(Equal("OK"))
configSet2 := client.ConfigSet(ctx, "max-key-size-in-cache", "1048576")
Expect(configSet2.Err()).NotTo(HaveOccurred())
Expect(configSet2.Val()).To(Equal("OK"))
configGet3 := client.ConfigGet(ctx, "cache-value-item-max-size")
Expect(configGet3.Val()["cache-value-item-max-size"]).To(Equal("1024"))

Copilot uses AI. Check for mistakes.
Comment on lines +443 to +458
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing whitespace detected. Remove trailing whitespace to maintain code cleanliness and consistency with Go formatting standards.

Suggested change
configGet2 := client.ConfigGet(ctx, "max-key-size-in-cache")
Expect(configGet2.Err()).NotTo(HaveOccurred())
Expect(configGet2.Val()).To(HaveKey("max-key-size-in-cache"))
configSet1 := client.ConfigSet(ctx, "cache-value-item-max-size", "1024")
Expect(configSet1.Err()).NotTo(HaveOccurred())
Expect(configSet1.Val()).To(Equal("OK"))
configSet2 := client.ConfigSet(ctx, "max-key-size-in-cache", "1048576")
Expect(configSet2.Err()).NotTo(HaveOccurred())
Expect(configSet2.Val()).To(Equal("OK"))
configGet3 := client.ConfigGet(ctx, "cache-value-item-max-size")
Expect(configGet3.Val()["cache-value-item-max-size"]).To(Equal("1024"))
configGet2 := client.ConfigGet(ctx, "max-key-size-in-cache")
Expect(configGet2.Err()).NotTo(HaveOccurred())
Expect(configGet2.Val()).To(HaveKey("max-key-size-in-cache"))
configSet1 := client.ConfigSet(ctx, "cache-value-item-max-size", "1024")
Expect(configSet1.Err()).NotTo(HaveOccurred())
Expect(configSet1.Val()).To(Equal("OK"))
configSet2 := client.ConfigSet(ctx, "max-key-size-in-cache", "1048576")
Expect(configSet2.Err()).NotTo(HaveOccurred())
Expect(configSet2.Val()).To(Equal("OK"))
configGet3 := client.ConfigGet(ctx, "cache-value-item-max-size")
Expect(configGet3.Val()["cache-value-item-max-size"]).To(Equal("1024"))

Copilot uses AI. Check for mistakes.
configGet4 := client.ConfigGet(ctx, "max-key-size-in-cache")
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing error check before accessing result. The error should be checked with Expect(configGet4.Err()).NotTo(HaveOccurred()) before accessing configGet4.Val() to prevent potential panics if the ConfigGet operation fails.

Suggested change
configGet4 := client.ConfigGet(ctx, "max-key-size-in-cache")
configGet4 := client.ConfigGet(ctx, "max-key-size-in-cache")
Expect(configGet4.Err()).NotTo(HaveOccurred())

Copilot uses AI. Check for mistakes.
Expect(configGet4.Val()["max-key-size-in-cache"]).To(Equal("1048576"))
})
//It("should DBSize", func() {
// Expect(client.Set(ctx, "key", "value", 0).Val()).To(Equal("OK"))
// Expect(client.Do(ctx, "info", "keyspace", "1").Err()).NotTo(HaveOccurred())
Expand Down Expand Up @@ -794,5 +819,27 @@ var _ = Describe("Server", func() {
Expect(client.Get(ctx, "foo").Err()).To(MatchError(redis.Nil))
Expect(client.Get(ctx, "key1").Err()).To(MatchError(redis.Nil))
})

Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing whitespace detected. Remove trailing whitespace to maintain code cleanliness and consistency with Go formatting standards.

Suggested change

Copilot uses AI. Check for mistakes.
//fix: added the correct loading of admin-cmd-list in the configuration file
It("should load admin-cmd-list from config correctly", func() {
configGet := client.ConfigGet(ctx, "admin-cmd-list")
Expect(configGet.Err()).NotTo(HaveOccurred())
Expect(configGet.Val()).To(HaveLen(1))

Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing whitespace detected. Remove trailing whitespace to maintain code cleanliness and consistency with Go formatting standards.

Suggested change

Copilot uses AI. Check for mistakes.
adminCmdList, ok := configGet.Val()["admin-cmd-list"]
Expect(ok).To(BeTrue())
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing whitespace detected. Remove trailing whitespace to maintain code cleanliness and consistency with Go formatting standards.

Copilot uses AI. Check for mistakes.

Expect(adminCmdList).To(ContainSubstring("auth"))
Expect(adminCmdList).To(ContainSubstring("config"))
Expect(adminCmdList).To(ContainSubstring("info"))
Expect(adminCmdList).To(ContainSubstring("ping"))
Expect(adminCmdList).To(ContainSubstring("monitor"))
})

// fix add auth command to admin-thread-pool
It("should process auth command in admin thread pool", func() {
auth := client.Do(ctx, "auth", "wrongpassword")
Expect(auth.Err()).To(HaveOccurred())
})
})
})
Loading