Skip to content

Commit 323c6b7

Browse files
committed
comments
1 parent 0f4498f commit 323c6b7

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

dbos/serialization.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,20 +49,15 @@ func deserialize(data *string) (any, error) {
4949
func safeGobRegister(value any, logger *slog.Logger) {
5050
defer func() {
5151
if r := recover(); r != nil {
52-
// Only catch specific duplicate registration errors
5352
if errStr, ok := r.(string); ok {
5453
// Check if this is one of the two specific duplicate registration errors we want to ignore
55-
// These patterns come from gob's RegisterName function
5654
// See https://cs.opensource.google/go/go/+/refs/tags/go1.25.1:src/encoding/gob/type.go;l=832
5755
if strings.Contains(errStr, "gob: registering duplicate types for") ||
5856
strings.Contains(errStr, "gob: registering duplicate names for") {
59-
// Log at debug level since these specific conflicts are expected and harmless
6057
if logger != nil {
61-
logger.Debug("gob registration conflict",
62-
"type", fmt.Sprintf("%T", value),
63-
"error", r)
58+
logger.Debug("gob registration conflict", "type", fmt.Sprintf("%T", value), "error", r)
6459
}
65-
return // Recover from this specific panic
60+
return
6661
}
6762
}
6863
// Re-panic for any other errors

0 commit comments

Comments
 (0)