Skip to content

Commit fc8c974

Browse files
committed
refactor: add detailed log on agent restart
Consolidate hot-update restart logic with a single batch macro, fix dispatcher-only restart wording, preserve dispatcher reasons when escalation triggers an agent restart, and avoid restart flag overwrite by using accumulated restart_value updates.
1 parent 4023a5b commit fc8c974

4 files changed

Lines changed: 1256 additions & 1227 deletions

File tree

agent/crates/public/src/codecs/hessian2.rs

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,18 @@ impl Hessian2Decoder {
9090
}
9191
}
9292
// int
93-
0x80..=0xbf | 0xc0..=0xcf | 0xd0..=0xd7 | BC_INT => {
94-
Self::to_hessian_value(Self::decode_i32(bytes, start), bytes.len(), HessianValue::Int)
95-
}
93+
0x80..=0xbf | 0xc0..=0xcf | 0xd0..=0xd7 | BC_INT => Self::to_hessian_value(
94+
Self::decode_i32(bytes, start),
95+
bytes.len(),
96+
HessianValue::Int,
97+
),
9698
// long
9799
0xd8..=0xef | 0xf0..=0xff | 0x38..=0x3f | BC_LONG_INT | BC_LONG => {
98-
Self::to_hessian_value(Self::decode_i64(bytes, start), bytes.len(), HessianValue::Long)
100+
Self::to_hessian_value(
101+
Self::decode_i64(bytes, start),
102+
bytes.len(),
103+
HessianValue::Long,
104+
)
99105
}
100106
// date
101107
BC_DATE | BC_DATE_MINUTE => Self::to_hessian_value(
@@ -139,12 +145,18 @@ impl Hessian2Decoder {
139145
None => (None, bytes.len()),
140146
},
141147
// hashmap
142-
BC_MAP | BC_MAP_UNTYPED => {
143-
Self::to_hessian_value(self.decode_map(bytes, start), bytes.len(), HessianValue::Map)
144-
}
148+
BC_MAP | BC_MAP_UNTYPED => Self::to_hessian_value(
149+
self.decode_map(bytes, start),
150+
bytes.len(),
151+
HessianValue::Map,
152+
),
145153
// object,只能处理为 hashmap
146154
BC_OBJECT_DEF | BC_OBJECT | BC_OBJECT_DIRECT..=BC_OBJECT_DIRECT_MAX => {
147-
Self::to_hessian_value(self.decode_obj(bytes, start), bytes.len(), HessianValue::Map)
155+
Self::to_hessian_value(
156+
self.decode_obj(bytes, start),
157+
bytes.len(),
158+
HessianValue::Map,
159+
)
148160
}
149161
_ => (None, bytes.len()), // 如果不符合任何一种,表示这个 tag 没有意义,直接丢弃剩余所有数据
150162
}

0 commit comments

Comments
 (0)