songzhendong commented on PR #139:
URL: 
https://github.com/apache/skywalking-nodejs/pull/139#issuecomment-4816795636

   <html>
   <body>
   <!--StartFragment--><p style="--tw-space-y-reverse: 0; margin-block: 0px 
16px; margin: 0px 0px 6px; word-break: break-word; color: rgba(228, 228, 228, 
0.92); font-family: &quot;Segoe WPC&quot;, &quot;Segoe UI&quot;, sans-serif; 
font-size: 13px; font-style: normal; font-variant-ligatures: normal; 
font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 
2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; 
word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; 
background-color: rgb(24, 24, 24); text-decoration-thickness: initial; 
text-decoration-style: initial; text-decoration-color: initial;">Thank you for 
the detailed review. Your feedback on Node-agent-specific lifecycle and async 
behavior was extremely valuable. I have addressed all five issues you raised; 
the fixes are summarized below.</p><hr class="my-6 border-border" 
data-streamdown="horizontal-rule" style="--tw-space-y-reverse: 0; margin-block: 
0px 16px; margin: 16px 
 0px; border-right: none; border-bottom: none; border-left: none; border-image: 
initial; border-top: 1px solid color(srgb 0.894118 0.894118 0.894118 / 
0.0737255); font-family: &quot;Segoe WPC&quot;, &quot;Segoe UI&quot;, 
sans-serif; font-size: 13px; font-style: normal; font-variant-ligatures: 
normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; 
orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 
2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; 
background-color: rgb(24, 24, 24); text-decoration-thickness: initial; 
text-decoration-style: initial; text-decoration-color: initial;"><h2 
class="mt-6 mb-2 font-semibold text-2xl" data-streamdown="heading-2" 
style="--tw-space-y-reverse: 0; margin-block: 0px 16px; margin-bottom: 10px; 
--tw-font-weight: 600; font-weight: 600; color: rgba(228, 228, 228, 0.92); 
line-height: 1.25; font-size: 1.3em; margin-top: 20px; font-family: &quot;Segoe 
WPC&quot;, &quot;Segoe UI&quot;,
  sans-serif; font-style: normal; font-variant-ligatures: normal; 
font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: 
start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; 
-webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(24, 
24, 24); text-decoration-thickness: initial; text-decoration-style: initial; 
text-decoration-color: initial;">Overview</h2><p style="--tw-space-y-reverse: 
0; margin-block: 0px 16px; margin: 6px 0px; word-break: break-word; color: 
rgba(228, 228, 228, 0.92); font-family: &quot;Segoe WPC&quot;, &quot;Segoe 
UI&quot;, sans-serif; font-size: 13px; font-style: normal; 
font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; 
letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; 
text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 
0px; white-space: normal; background-color: rgb(24, 24, 24); 
text-decoration-thickness: initial; text-decora
 tion-style: initial; text-decoration-color: initial;">This update adds<span> 
</span><span class="font-semibold" data-streamdown="strong" 
style="--tw-font-weight: 600; font-weight: 600;">2 commits</span><span> 
</span>on<span> </span><a 
href="https://github.com/songzhendong/skywalking-nodejs/tree/feature/nodejs-grpc-v1-runtime-metrics";
 target="_blank" rel="noopener noreferrer" style="text-decoration: rgb(129, 
161, 193); color: rgb(129, 161, 193); cursor: pointer; overflow-wrap: 
anywhere;"><code class="md-inline-path-filename-like" style="padding: 1.5px 
4px; border-radius: 5px; background-color: color(srgb 0.894118 0.894118 
0.894118 / 0.0737255); color: color(srgb 0.894118 0.894118 0.894118 / 
0.866275); font-family: Consolas, &quot;Courier New&quot;, monospace; 
font-size: 0.9em; line-height: 1.4; word-break: break-all;"><span 
class="md-inline-path-prefix">feature/</span><span 
class="md-inline-path-filename">nodejs-grpc-v1-runtime-metrics</span></code></a>:</p><div
 class="ui-scroll-a
 rea" data-scroll-padding="4" data-visibility="hover" 
data-direction="horizontal" style="--tw-space-y-reverse: 0; margin-block: 0px 
16px; --scrollbar-size: 6px; --scrollbar-inset: 0px; 
--scrollbar-thumb-top-offset: 6px; --scroll-area-scroll-padding: 4px; position: 
relative; overflow: hidden; display: grid; grid-template: 1fr / 1fr; margin: 
1em 0px; border-color: color(srgb 0.894118 0.894118 0.894118 / 0.0737255); 
border-style: solid; border-width: 1px; border-image: none 100% / 1 / 0 
stretch; border-radius: 6px; color: rgba(228, 228, 228, 0.92); font-family: 
&quot;Segoe WPC&quot;, &quot;Segoe UI&quot;, sans-serif; font-size: 13px; 
font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; 
font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; 
text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; 
-webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(24, 
24, 24); text-decoration-thickness: initial; text-decorati
 on-style: initial; text-decoration-color: initial;"><div 
class="ui-scroll-area__viewport" style="grid-area: 1 / 1; min-height: 0px; 
max-height: 100%; border-radius: inherit; overflow: auto hidden; 
scroll-padding: 0px 4px; overscroll-behavior: contain auto; scrollbar-width: 
none !important;"><div class="ui-scroll-area__content" style="box-sizing: 
border-box; width: auto; min-width: 100%; max-width: 100%; min-height: 100%; 
display: flex; flex-direction: row; height: fit-content;">
   Commit | Description
   -- | --
   78f92aa | Core fixes for all review items
   9755dd1 | Follow-up: restart the trace report loop after manual flush()
   
   </div></div></div><p style="--tw-space-y-reverse: 0; margin-block: 0px 16px; 
margin: 6px 0px; word-break: break-word; color: rgba(228, 228, 228, 0.92); 
font-family: &quot;Segoe WPC&quot;, &quot;Segoe UI&quot;, sans-serif; 
font-size: 13px; font-style: normal; font-variant-ligatures: normal; 
font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 
2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; 
word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; 
background-color: rgb(24, 24, 24); text-decoration-thickness: initial; 
text-decoration-style: initial; text-decoration-color: initial;">Before 
updating this PR, I ran the<span> </span><span class="font-semibold" 
data-streamdown="strong" style="--tw-font-weight: 600; font-weight: 600;">full 
CI pipeline</span><span> </span>on my fork (Build / Test / License) —<span> 
</span><span class="font-semibold" data-streamdown="strong" 
style="--tw-font-weight: 600; font-weight: 600;">
 all 34 checks passed</span>.</p><hr class="my-6 border-border" 
data-streamdown="horizontal-rule" style="--tw-space-y-reverse: 0; margin-block: 
0px 16px; margin: 16px 0px; border-right: none; border-bottom: none; 
border-left: none; border-image: initial; border-top: 1px solid color(srgb 
0.894118 0.894118 0.894118 / 0.0737255); font-family: &quot;Segoe WPC&quot;, 
&quot;Segoe UI&quot;, sans-serif; font-size: 13px; font-style: normal; 
font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; 
letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; 
text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 
0px; white-space: normal; background-color: rgb(24, 24, 24); 
text-decoration-thickness: initial; text-decoration-style: initial; 
text-decoration-color: initial;"><h2 class="mt-6 mb-2 font-semibold text-2xl" 
data-streamdown="heading-2" style="--tw-space-y-reverse: 0; margin-block: 0px 
16px; margin-bottom: 10px; --tw-font-weight: 600
 ; font-weight: 600; color: rgba(228, 228, 228, 0.92); line-height: 1.25; 
font-size: 1.3em; margin-top: 20px; font-family: &quot;Segoe WPC&quot;, 
&quot;Segoe UI&quot;, sans-serif; font-style: normal; font-variant-ligatures: 
normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; 
text-align: start; text-indent: 0px; text-transform: none; widows: 2; 
word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; 
background-color: rgb(24, 24, 24); text-decoration-thickness: initial; 
text-decoration-style: initial; text-decoration-color: initial;">Fix details (5 
items)</h2><h3 class="mt-6 mb-2 font-semibold text-xl" 
data-streamdown="heading-3" style="--tw-space-y-reverse: 0; margin-block: 0px 
16px; margin-bottom: 8px; font-size: 1.15em; line-height: 1.25; 
--tw-font-weight: 600; font-weight: 600; color: rgba(228, 228, 228, 0.92); 
margin-top: 18px; font-family: &quot;Segoe WPC&quot;, &quot;Segoe UI&quot;, 
sans-serif; font-style: normal; font-variant-ligatures: normal
 ; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: 
start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; 
-webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(24, 
24, 24); text-decoration-thickness: initial; text-decoration-style: initial; 
text-decoration-color: initial;">1. Blocking —<span> </span><code class="" 
style="padding: 1.5px 4px; border-radius: 5px; background-color: color(srgb 
0.894118 0.894118 0.894118 / 0.0737255); color: color(srgb 0.894118 0.894118 
0.894118 / 0.866275); font-family: Consolas, &quot;Courier New&quot;, 
monospace; font-size: 0.9em; line-height: 1.4; word-break: 
break-all;">shutdown()</code><span> </span>and stale connectivity 
callbacks</h3><p style="--tw-space-y-reverse: 0; margin-block: 0px 16px; 
margin: 6px 0px; word-break: break-word; color: rgba(228, 228, 228, 0.92); 
font-family: &quot;Segoe WPC&quot;, &quot;Segoe UI&quot;, sans-serif; 
font-size: 13px; font-style: normal; font-
 variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; 
letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; 
text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 
0px; white-space: normal; background-color: rgb(24, 24, 24); 
text-decoration-thickness: initial; text-decoration-style: initial; 
text-decoration-color: initial;"><span class="font-semibold" 
data-streamdown="strong" style="--tw-font-weight: 600; font-weight: 
600;">File:</span><span> </span><a 
href="https://github.com/songzhendong/skywalking-nodejs/blob/feature/nodejs-grpc-v1-review-fixes/src/agent/core/remote/GRPCChannelManager.ts";
 target="_blank" rel="noopener noreferrer" style="text-decoration: rgb(129, 
161, 193); color: rgb(129, 161, 193); cursor: pointer; overflow-wrap: 
anywhere;"><code class="md-clickable-code md-inline-path-filename-like" 
role="button" tabindex="0" style="padding: 1.5px 4px; border-radius: 5px; 
background-color: color(srgb 0.894118 0.894118
  0.894118 / 0.0737255); color: rgb(129, 161, 193); font-family: Consolas, 
&quot;Courier New&quot;, monospace; font-size: 0.9em; line-height: 1.4; 
word-break: break-all; cursor: pointer;"><span 
class="md-inline-path-filename">GRPCChannelManager.ts</span></code></a></p><ul 
class="list-inside list-disc whitespace-normal [li_&amp;]:pl-6" 
data-streamdown="unordered-list" style="--tw-space-y-reverse: 0; margin-block: 
0px 16px; list-style-type: disc; white-space: normal; padding-left: 2em; 
display: flex !important; flex-direction: column !important; gap: 6px 
!important; margin: 6px 0px !important; color: rgba(228, 228, 228, 0.92); 
font-family: &quot;Segoe WPC&quot;, &quot;Segoe UI&quot;, sans-serif; 
font-size: 13px; font-style: normal; font-variant-ligatures: normal; 
font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 
2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; 
word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(24
 , 24, 24); text-decoration-thickness: initial; text-decoration-style: initial; 
text-decoration-color: initial;"><li class="py-1 [&amp;&gt;p]:inline" 
data-streamdown="list-item" style="padding-block: 4px; word-break: break-word; 
padding: 0px !important;">Added an idempotent<span> </span><code class="" 
style="padding: 1.5px 4px; border-radius: 5px; background-color: color(srgb 
0.894118 0.894118 0.894118 / 0.0737255); color: color(srgb 0.894118 0.894118 
0.894118 / 0.866275); font-family: Consolas, &quot;Courier New&quot;, 
monospace; font-size: 0.9em; line-height: 1.4; word-break: 
break-all;">closed</code><span> </span>flag; reset on each<span> </span><code 
class="" style="padding: 1.5px 4px; border-radius: 5px; background-color: 
color(srgb 0.894118 0.894118 0.894118 / 0.0737255); color: color(srgb 0.894118 
0.894118 0.894118 / 0.866275); font-family: Consolas, &quot;Courier New&quot;, 
monospace; font-size: 0.9em; line-height: 1.4; word-break: 
break-all;">boot()</code>.</li><li class=
 "py-1 [&amp;&gt;p]:inline" data-streamdown="list-item" style="padding-block: 
4px; word-break: break-word; padding: 0px !important;"><code class="" 
style="padding: 1.5px 4px; border-radius: 5px; background-color: color(srgb 
0.894118 0.894118 0.894118 / 0.0737255); color: color(srgb 0.894118 0.894118 
0.894118 / 0.866275); font-family: Consolas, &quot;Courier New&quot;, 
monospace; font-size: 0.9em; line-height: 1.4; word-break: 
break-all;">shutdown()</code>: set<span> </span><code class="" style="padding: 
1.5px 4px; border-radius: 5px; background-color: color(srgb 0.894118 0.894118 
0.894118 / 0.0737255); color: color(srgb 0.894118 0.894118 0.894118 / 
0.866275); font-family: Consolas, &quot;Courier New&quot;, monospace; 
font-size: 0.9em; line-height: 1.4; word-break: break-all;">closed</code>, hold 
the current managed channel, clear the reference, then call<span> </span><code 
class="" style="padding: 1.5px 4px; border-radius: 5px; background-color: 
color(srgb 0.894118 0.894118 0.89411
 8 / 0.0737255); color: color(srgb 0.894118 0.894118 0.894118 / 0.866275); 
font-family: Consolas, &quot;Courier New&quot;, monospace; font-size: 0.9em; 
line-height: 1.4; word-break: break-all;">shutdownNow()</code>.</li><li 
class="py-1 [&amp;&gt;p]:inline" data-streamdown="list-item" 
style="padding-block: 4px; word-break: break-word; padding: 0px 
!important;"><code class="" style="padding: 1.5px 4px; border-radius: 5px; 
background-color: color(srgb 0.894118 0.894118 0.894118 / 0.0737255); color: 
color(srgb 0.894118 0.894118 0.894118 / 0.866275); font-family: Consolas, 
&quot;Courier New&quot;, monospace; font-size: 0.9em; line-height: 1.4; 
word-break: break-all;">watchConnectivityState()</code>: guard at entry (<code 
class="" style="padding: 1.5px 4px; border-radius: 5px; background-color: 
color(srgb 0.894118 0.894118 0.894118 / 0.0737255); color: color(srgb 0.894118 
0.894118 0.894118 / 0.866275); font-family: Consolas, &quot;Courier New&quot;, 
monospace; font-size: 0.9em; line-height
 : 1.4; word-break: break-all;">closed</code><span> </span>or no managed 
channel); inside the grpc-js callback, additionally verify<span> </span><code 
class="" style="padding: 1.5px 4px; border-radius: 5px; background-color: 
color(srgb 0.894118 0.894118 0.894118 / 0.0737255); color: color(srgb 0.894118 
0.894118 0.894118 / 0.866275); font-family: Consolas, &quot;Courier New&quot;, 
monospace; font-size: 0.9em; line-height: 1.4; word-break: 
break-all;">closed</code><span> </span>and that<span> </span><code 
class="md-inline-path-filename-like" style="padding: 1.5px 4px; border-radius: 
5px; background-color: color(srgb 0.894118 0.894118 0.894118 / 0.0737255); 
color: color(srgb 0.894118 0.894118 0.894118 / 0.866275); font-family: 
Consolas, &quot;Courier New&quot;, monospace; font-size: 0.9em; line-height: 
1.4; word-break: break-all;"><span 
class="md-inline-path-filename">this.managedChannel</span></code><span> 
</span>still matches the watched channel instance.</li></ul><p style="--tw-
 space-y-reverse: 0; margin-block: 0px 16px; margin: 6px 0px; word-break: 
break-word; color: rgba(228, 228, 228, 0.92); font-family: &quot;Segoe 
WPC&quot;, &quot;Segoe UI&quot;, sans-serif; font-size: 13px; font-style: 
normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 
400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; 
text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 
0px; white-space: normal; background-color: rgb(24, 24, 24); 
text-decoration-thickness: initial; text-decoration-style: initial; 
text-decoration-color: initial;"><span class="font-semibold" 
data-streamdown="strong" style="--tw-font-weight: 600; font-weight: 
600;">Effect:</span><span> </span>after agent shutdown, stale connectivity 
watchers can no longer call<span> </span><code class="" style="padding: 1.5px 
4px; border-radius: 5px; background-color: color(srgb 0.894118 0.894118 
0.894118 / 0.0737255); color: color(srgb 0.894118 0.89411
 8 0.894118 / 0.866275); font-family: Consolas, &quot;Courier New&quot;, 
monospace; font-size: 0.9em; line-height: 1.4; word-break: 
break-all;">getChannel()</code><span> </span>on a torn-down manager.</p><hr 
class="my-6 border-border" data-streamdown="horizontal-rule" 
style="--tw-space-y-reverse: 0; margin-block: 0px 16px; margin: 16px 0px; 
border-right: none; border-bottom: none; border-left: none; border-image: 
initial; border-top: 1px solid color(srgb 0.894118 0.894118 0.894118 / 
0.0737255); font-family: &quot;Segoe WPC&quot;, &quot;Segoe UI&quot;, 
sans-serif; font-size: 13px; font-style: normal; font-variant-ligatures: 
normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; 
orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 
2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; 
background-color: rgb(24, 24, 24); text-decoration-thickness: initial; 
text-decoration-style: initial; text-decoration-color: initial;"
 ><h3 class="mt-6 mb-2 font-semibold text-xl" data-streamdown="heading-3" 
 >style="--tw-space-y-reverse: 0; margin-block: 0px 16px; margin-bottom: 8px; 
 >font-size: 1.15em; line-height: 1.25; --tw-font-weight: 600; font-weight: 
 >600; color: rgba(228, 228, 228, 0.92); margin-top: 18px; font-family: 
 >&quot;Segoe WPC&quot;, &quot;Segoe UI&quot;, sans-serif; font-style: normal; 
 >font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: 
 >normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: 
 >none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; 
 >white-space: normal; background-color: rgb(24, 24, 24); 
 >text-decoration-thickness: initial; text-decoration-style: initial; 
 >text-decoration-color: initial;">2. High — heartbeat still using a stale 
 >client after disconnect</h3><p style="--tw-space-y-reverse: 0; margin-block: 
 >0px 16px; margin: 6px 0px; word-break: break-word; color: rgba(228, 228, 228, 
 >0.92); font-family: &quot;Segoe WPC&quot;, &quot;Segoe UI
 &quot;, sans-serif; font-size: 13px; font-style: normal; 
font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; 
letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; 
text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 
0px; white-space: normal; background-color: rgb(24, 24, 24); 
text-decoration-thickness: initial; text-decoration-style: initial; 
text-decoration-color: initial;"><span class="font-semibold" 
data-streamdown="strong" style="--tw-font-weight: 600; font-weight: 
600;">File:</span><span> </span><a 
href="https://github.com/songzhendong/skywalking-nodejs/blob/feature/nodejs-grpc-v1-review-fixes/src/agent/core/remote/ServiceManagementClient.ts";
 target="_blank" rel="noopener noreferrer" style="text-decoration: rgb(129, 
161, 193); color: rgb(129, 161, 193); cursor: pointer; overflow-wrap: 
anywhere;"><code class="md-clickable-code md-inline-path-filename-like" 
role="button" tabindex="0" style="padding: 1.5px 4px;
  border-radius: 5px; background-color: color(srgb 0.894118 0.894118 0.894118 / 
0.0737255); color: rgb(129, 161, 193); font-family: Consolas, &quot;Courier 
New&quot;, monospace; font-size: 0.9em; line-height: 1.4; word-break: 
break-all; cursor: pointer;"><span 
class="md-inline-path-filename">ServiceManagementClient.ts</span></code></a></p><ul
 class="list-inside list-disc whitespace-normal [li_&amp;]:pl-6" 
data-streamdown="unordered-list" style="--tw-space-y-reverse: 0; margin-block: 
0px 16px; list-style-type: disc; white-space: normal; padding-left: 2em; 
display: flex !important; flex-direction: column !important; gap: 6px 
!important; margin: 6px 0px !important; color: rgba(228, 228, 228, 0.92); 
font-family: &quot;Segoe WPC&quot;, &quot;Segoe UI&quot;, sans-serif; 
font-size: 13px; font-style: normal; font-variant-ligatures: normal; 
font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 
2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; wor
 d-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(24, 24, 
24); text-decoration-thickness: initial; text-decoration-style: initial; 
text-decoration-color: initial;"><li class="py-1 [&amp;&gt;p]:inline" 
data-streamdown="list-item" style="padding-block: 4px; word-break: break-word; 
padding: 0px !important;">Maintain local connection<span> </span><code class="" 
style="padding: 1.5px 4px; border-radius: 5px; background-color: color(srgb 
0.894118 0.894118 0.894118 / 0.0737255); color: color(srgb 0.894118 0.894118 
0.894118 / 0.866275); font-family: Consolas, &quot;Courier New&quot;, 
monospace; font-size: 0.9em; line-height: 1.4; word-break: 
break-all;">status</code>; create the heartbeat stub only on<span> </span><code 
class="" style="padding: 1.5px 4px; border-radius: 5px; background-color: 
color(srgb 0.894118 0.894118 0.894118 / 0.0737255); color: color(srgb 0.894118 
0.894118 0.894118 / 0.866275); font-family: Consolas, &quot;Courier New&quot;, 
monospace; font-size:
  0.9em; line-height: 1.4; word-break: break-all;">CONNECTED</code>, destroy it 
on<span> </span><code class="" style="padding: 1.5px 4px; border-radius: 5px; 
background-color: color(srgb 0.894118 0.894118 0.894118 / 0.0737255); color: 
color(srgb 0.894118 0.894118 0.894118 / 0.866275); font-family: Consolas, 
&quot;Courier New&quot;, monospace; font-size: 0.9em; line-height: 1.4; 
word-break: break-all;">DISCONNECT</code>.</li><li class="py-1 
[&amp;&gt;p]:inline" data-streamdown="list-item" style="padding-block: 4px; 
word-break: break-word; padding: 0px !important;"><code class="" 
style="padding: 1.5px 4px; border-radius: 5px; background-color: color(srgb 
0.894118 0.894118 0.894118 / 0.0737255); color: color(srgb 0.894118 0.894118 
0.894118 / 0.866275); font-family: Consolas, &quot;Courier New&quot;, 
monospace; font-size: 0.9em; line-height: 1.4; word-break: 
break-all;">sendHeartbeat()</code><span> </span>runs only when<span> 
</span><code class="" style="padding: 1.5px 4px; border-rad
 ius: 5px; background-color: color(srgb 0.894118 0.894118 0.894118 / 
0.0737255); color: color(srgb 0.894118 0.894118 0.894118 / 0.866275); 
font-family: Consolas, &quot;Courier New&quot;, monospace; font-size: 0.9em; 
line-height: 1.4; word-break: break-all;">status === CONNECTED</code><span> 
</span>and the management stub exists.</li><li class="py-1 [&amp;&gt;p]:inline" 
data-streamdown="list-item" style="padding-block: 4px; word-break: break-word; 
padding: 0px !important;">Both<span> </span><code 
class="md-inline-variable-like" style="padding: 1.5px 4px; border-radius: 5px; 
background-color: color(srgb 0.894118 0.894118 0.894118 / 0.0737255); color: 
color(srgb 0.894118 0.894118 0.894118 / 0.866275); font-family: Consolas, 
&quot;Courier New&quot;, monospace; font-size: 0.9em; line-height: 1.4; 
word-break: break-all;">reportInstanceProperties</code><span> </span>and<span> 
</span><code class="md-inline-variable-like" style="padding: 1.5px 4px; 
border-radius: 5px; background-color: co
 lor(srgb 0.894118 0.894118 0.894118 / 0.0737255); color: color(srgb 0.894118 
0.894118 0.894118 / 0.866275); font-family: Consolas, &quot;Courier New&quot;, 
monospace; font-size: 0.9em; line-height: 1.4; word-break: 
break-all;">keepAlive</code><span> </span>now use per-call deadlines (<code 
class="md-inline-path-filename-like" style="padding: 1.5px 4px; border-radius: 
5px; background-color: color(srgb 0.894118 0.894118 0.894118 / 0.0737255); 
color: color(srgb 0.894118 0.894118 0.894118 / 0.866275); font-family: 
Consolas, &quot;Courier New&quot;, monospace; font-size: 0.9em; line-height: 
1.4; word-break: break-all;"><span 
class="md-inline-path-filename">config.traceTimeout</span></code>).</li></ul><hr
 class="my-6 border-border" data-streamdown="horizontal-rule" 
style="--tw-space-y-reverse: 0; margin-block: 0px 16px; margin: 16px 0px; 
border-right: none; border-bottom: none; border-left: none; border-image: 
initial; border-top: 1px solid color(srgb 0.894118 0.894118 0.894118 / 0.07372
 55); font-family: &quot;Segoe WPC&quot;, &quot;Segoe UI&quot;, sans-serif; 
font-size: 13px; font-style: normal; font-variant-ligatures: normal; 
font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 
2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; 
word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; 
background-color: rgb(24, 24, 24); text-decoration-thickness: initial; 
text-decoration-style: initial; text-decoration-color: initial;"><h3 
class="mt-6 mb-2 font-semibold text-xl" data-streamdown="heading-3" 
style="--tw-space-y-reverse: 0; margin-block: 0px 16px; margin-bottom: 8px; 
font-size: 1.15em; line-height: 1.25; --tw-font-weight: 600; font-weight: 600; 
color: rgba(228, 228, 228, 0.92); margin-top: 18px; font-family: &quot;Segoe 
WPC&quot;, &quot;Segoe UI&quot;, sans-serif; font-style: normal; 
font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: 
normal; orphans: 2; text-align: start; text-indent
 : 0px; text-transform: none; widows: 2; word-spacing: 0px; 
-webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(24, 
24, 24); text-decoration-thickness: initial; text-decoration-style: initial; 
text-decoration-color: initial;">3. High —<span> </span><code class="" 
style="padding: 1.5px 4px; border-radius: 5px; background-color: color(srgb 
0.894118 0.894118 0.894118 / 0.0737255); color: color(srgb 0.894118 0.894118 
0.894118 / 0.866275); font-family: Consolas, &quot;Courier New&quot;, 
monospace; font-size: 0.9em; line-height: 1.4; word-break: 
break-all;">reportError()</code><span> </span>was effectively a no-op</h3><p 
style="--tw-space-y-reverse: 0; margin-block: 0px 16px; margin: 6px 0px; 
word-break: break-word; color: rgba(228, 228, 228, 0.92); font-family: 
&quot;Segoe WPC&quot;, &quot;Segoe UI&quot;, sans-serif; font-size: 13px; 
font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; 
font-weight: 400; letter-spacing: normal; orphans: 
 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; 
word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; 
background-color: rgb(24, 24, 24); text-decoration-thickness: initial; 
text-decoration-style: initial; text-decoration-color: initial;"><span 
class="font-semibold" data-streamdown="strong" style="--tw-font-weight: 600; 
font-weight: 600;">File:</span><span> </span><a 
href="https://github.com/songzhendong/skywalking-nodejs/blob/feature/nodejs-grpc-v1-review-fixes/src/agent/core/remote/GRPCChannelManager.ts";
 target="_blank" rel="noopener noreferrer" style="text-decoration: rgb(129, 
161, 193); color: rgb(129, 161, 193); cursor: pointer; overflow-wrap: 
anywhere;"><code class="md-clickable-code md-inline-path-filename-like" 
role="button" tabindex="0" style="padding: 1.5px 4px; border-radius: 5px; 
background-color: color(srgb 0.894118 0.894118 0.894118 / 0.0737255); color: 
rgb(129, 161, 193); font-family: Consolas, &quot;Courier New&quot;, monosp
 ace; font-size: 0.9em; line-height: 1.4; word-break: break-all; cursor: 
pointer;"><span 
class="md-inline-path-filename">GRPCChannelManager.ts</span></code></a></p><ul 
class="list-inside list-disc whitespace-normal [li_&amp;]:pl-6" 
data-streamdown="unordered-list" style="--tw-space-y-reverse: 0; margin-block: 
0px 16px; list-style-type: disc; white-space: normal; padding-left: 2em; 
display: flex !important; flex-direction: column !important; gap: 6px 
!important; margin: 6px 0px !important; color: rgba(228, 228, 228, 0.92); 
font-family: &quot;Segoe WPC&quot;, &quot;Segoe UI&quot;, sans-serif; 
font-size: 13px; font-style: normal; font-variant-ligatures: normal; 
font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 
2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; 
word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(24, 
24, 24); text-decoration-thickness: initial; text-decoration-style: initial; 
text-decoration-color: ini
 tial;"><li class="py-1 [&amp;&gt;p]:inline" data-streamdown="list-item" 
style="padding-block: 4px; word-break: break-word; padding: 0px 
!important;">Reworked<span> </span><code class="" style="padding: 1.5px 4px; 
border-radius: 5px; background-color: color(srgb 0.894118 0.894118 0.894118 / 
0.0737255); color: color(srgb 0.894118 0.894118 0.894118 / 0.866275); 
font-family: Consolas, &quot;Courier New&quot;, monospace; font-size: 0.9em; 
line-height: 1.4; word-break: break-all;">reportError()</code>:<ul 
class="list-inside list-disc whitespace-normal [li_&amp;]:pl-6" 
data-streamdown="unordered-list" style="list-style-type: disc; white-space: 
normal; padding-left: 2em; display: flex !important; flex-direction: column 
!important; gap: 6px !important; margin: 6px 0px 0px !important;"><li 
class="py-1 [&amp;&gt;p]:inline" data-streamdown="list-item" 
style="padding-block: 4px; word-break: break-word; padding: 0px 
!important;">gRPC<span> </span><span class="font-semibold" data-streamdown="str
 ong" style="--tw-font-weight: 600; font-weight: 600;">network</span><span> 
</span>errors (<code class="" style="padding: 1.5px 4px; border-radius: 5px; 
background-color: color(srgb 0.894118 0.894118 0.894118 / 0.0737255); color: 
color(srgb 0.894118 0.894118 0.894118 / 0.866275); font-family: Consolas, 
&quot;Courier New&quot;, monospace; font-size: 0.9em; line-height: 1.4; 
word-break: break-all;">UNAVAILABLE</code>,<span> </span><code class="" 
style="padding: 1.5px 4px; border-radius: 5px; background-color: color(srgb 
0.894118 0.894118 0.894118 / 0.0737255); color: color(srgb 0.894118 0.894118 
0.894118 / 0.866275); font-family: Consolas, &quot;Courier New&quot;, 
monospace; font-size: 0.9em; line-height: 1.4; word-break: 
break-all;">PERMISSION_DENIED</code>,<span> </span><code class="" 
style="padding: 1.5px 4px; border-radius: 5px; background-color: color(srgb 
0.894118 0.894118 0.894118 / 0.0737255); color: color(srgb 0.894118 0.894118 
0.894118 / 0.866275); font-family: Consolas, &
 quot;Courier New&quot;, monospace; font-size: 0.9em; line-height: 1.4; 
word-break: break-all;">UNAUTHENTICATED</code>,<span> </span><code class="" 
style="padding: 1.5px 4px; border-radius: 5px; background-color: color(srgb 
0.894118 0.894118 0.894118 / 0.0737255); color: color(srgb 0.894118 0.894118 
0.894118 / 0.866275); font-family: Consolas, &quot;Courier New&quot;, 
monospace; font-size: 0.9em; line-height: 1.4; word-break: 
break-all;">RESOURCE_EXHAUSTED</code>,<span> </span><code class="" 
style="padding: 1.5px 4px; border-radius: 5px; background-color: color(srgb 
0.894118 0.894118 0.894118 / 0.0737255); color: color(srgb 0.894118 0.894118 
0.894118 / 0.866275); font-family: Consolas, &quot;Courier New&quot;, 
monospace; font-size: 0.9em; line-height: 1.4; word-break: 
break-all;">UNKNOWN</code>) →<span> </span><code class="" style="padding: 1.5px 
4px; border-radius: 5px; background-color: color(srgb 0.894118 0.894118 
0.894118 / 0.0737255); color: color(srgb 0.894118 0.894118 0.8
 94118 / 0.866275); font-family: Consolas, &quot;Courier New&quot;, monospace; 
font-size: 0.9em; line-height: 1.4; word-break: 
break-all;">notify(DISCONNECT)</code>, so periodic work stops immediately while 
grpc-js handles transport reconnect.</li><li class="py-1 [&amp;&gt;p]:inline" 
data-streamdown="list-item" style="padding-block: 4px; word-break: break-word; 
padding: 0px !important;">Non-network errors → log only; no disconnect 
signal.</li></ul></li></ul><hr class="my-6 border-border" 
data-streamdown="horizontal-rule" style="--tw-space-y-reverse: 0; margin-block: 
0px 16px; margin: 16px 0px; border-right: none; border-bottom: none; 
border-left: none; border-image: initial; border-top: 1px solid color(srgb 
0.894118 0.894118 0.894118 / 0.0737255); font-family: &quot;Segoe WPC&quot;, 
&quot;Segoe UI&quot;, sans-serif; font-size: 13px; font-style: normal; 
font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; 
letter-spacing: normal; orphans: 2; text-align: start;
  text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; 
-webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(24, 
24, 24); text-decoration-thickness: initial; text-decoration-style: initial; 
text-decoration-color: initial;"><h3 class="mt-6 mb-2 font-semibold text-xl" 
data-streamdown="heading-3" style="--tw-space-y-reverse: 0; margin-block: 0px 
16px; margin-bottom: 8px; font-size: 1.15em; line-height: 1.25; 
--tw-font-weight: 600; font-weight: 600; color: rgba(228, 228, 228, 0.92); 
margin-top: 18px; font-family: &quot;Segoe WPC&quot;, &quot;Segoe UI&quot;, 
sans-serif; font-style: normal; font-variant-ligatures: normal; 
font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: 
start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; 
-webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(24, 
24, 24); text-decoration-thickness: initial; text-decoration-style: initial; 
text-decoration-color: initi
 al;">4. Medium — Java-style busy-wait (<code class="" style="padding: 1.5px 
4px; border-radius: 5px; background-color: color(srgb 0.894118 0.894118 
0.894118 / 0.0737255); color: color(srgb 0.894118 0.894118 0.894118 / 
0.866275); font-family: Consolas, &quot;Courier New&quot;, monospace; 
font-size: 0.9em; line-height: 1.4; word-break: 
break-all;">GRPCStreamServiceStatus</code>)</h3><p style="--tw-space-y-reverse: 
0; margin-block: 0px 16px; margin: 6px 0px; word-break: break-word; color: 
rgba(228, 228, 228, 0.92); font-family: &quot;Segoe WPC&quot;, &quot;Segoe 
UI&quot;, sans-serif; font-size: 13px; font-style: normal; 
font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; 
letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; 
text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 
0px; white-space: normal; background-color: rgb(24, 24, 24); 
text-decoration-thickness: initial; text-decoration-style: initial; text-decorat
 ion-color: initial;"><span class="font-semibold" data-streamdown="strong" 
style="--tw-font-weight: 600; font-weight: 600;">Change:</span><span> 
</span>removed<span> </span><a 
href="https://github.com/songzhendong/skywalking-nodejs/commit/78f92aa"; 
target="_blank" rel="noopener noreferrer" style="text-decoration: rgb(129, 161, 
193); color: rgb(129, 161, 193); cursor: pointer; overflow-wrap: 
anywhere;"><code class="md-inline-path-filename-like" style="padding: 1.5px 
4px; border-radius: 5px; background-color: color(srgb 0.894118 0.894118 
0.894118 / 0.0737255); color: color(srgb 0.894118 0.894118 0.894118 / 
0.866275); font-family: Consolas, &quot;Courier New&quot;, monospace; 
font-size: 0.9em; line-height: 1.4; word-break: break-all;"><span 
class="md-inline-path-filename">GRPCStreamServiceStatus.ts</span></code></a><span>
 </span>(deleted in<span> </span><code class="" style="padding: 1.5px 4px; 
border-radius: 5px; background-color: color(srgb 0.894118 0.894118 0.894118 / 
0.0737255); 
 color: color(srgb 0.894118 0.894118 0.894118 / 0.866275); font-family: 
Consolas, &quot;Courier New&quot;, monospace; font-size: 0.9em; line-height: 
1.4; word-break: break-all;">78f92aa</code>).</p><ul class="list-inside 
list-disc whitespace-normal [li_&amp;]:pl-6" data-streamdown="unordered-list" 
style="--tw-space-y-reverse: 0; margin-block: 0px 16px; list-style-type: disc; 
white-space: normal; padding-left: 2em; display: flex !important; 
flex-direction: column !important; gap: 6px !important; margin: 6px 0px 
!important; color: rgba(228, 228, 228, 0.92); font-family: &quot;Segoe 
WPC&quot;, &quot;Segoe UI&quot;, sans-serif; font-size: 13px; font-style: 
normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 
400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; 
text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 
0px; background-color: rgb(24, 24, 24); text-decoration-thickness: initial; 
text-decoration-style: i
 nitial; text-decoration-color: initial;"><li class="py-1 [&amp;&gt;p]:inline" 
data-streamdown="list-item" style="padding-block: 4px; word-break: break-word; 
padding: 0px !important;">Never used by Trace or Meter clients; dead 
code.</li><li class="py-1 [&amp;&gt;p]:inline" data-streamdown="list-item" 
style="padding-block: 4px; word-break: break-word; padding: 0px !important;">No 
busy-wait blocking logic remains in agent core.</li></ul><hr class="my-6 
border-border" data-streamdown="horizontal-rule" style="--tw-space-y-reverse: 
0; margin-block: 0px 16px; margin: 16px 0px; border-right: none; border-bottom: 
none; border-left: none; border-image: initial; border-top: 1px solid 
color(srgb 0.894118 0.894118 0.894118 / 0.0737255); font-family: &quot;Segoe 
WPC&quot;, &quot;Segoe UI&quot;, sans-serif; font-size: 13px; font-style: 
normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 
400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; 
text-t
 ransform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; 
white-space: normal; background-color: rgb(24, 24, 24); 
text-decoration-thickness: initial; text-decoration-style: initial; 
text-decoration-color: initial;"><h3 class="mt-6 mb-2 font-semibold text-xl" 
data-streamdown="heading-3" style="--tw-space-y-reverse: 0; margin-block: 0px 
16px; margin-bottom: 8px; font-size: 1.15em; line-height: 1.25; 
--tw-font-weight: 600; font-weight: 600; color: rgba(228, 228, 228, 0.92); 
margin-top: 18px; font-family: &quot;Segoe WPC&quot;, &quot;Segoe UI&quot;, 
sans-serif; font-style: normal; font-variant-ligatures: normal; 
font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: 
start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; 
-webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(24, 
24, 24); text-decoration-thickness: initial; text-decoration-style: initial; 
text-decoration-color: initial;">5. Medium —<span>�
 �</span><code class="" style="padding: 1.5px 4px; border-radius: 5px; 
background-color: color(srgb 0.894118 0.894118 0.894118 / 0.0737255); color: 
color(srgb 0.894118 0.894118 0.894118 / 0.866275); font-family: Consolas, 
&quot;Courier New&quot;, monospace; font-size: 0.9em; line-height: 1.4; 
word-break: break-all;">flush()</code><span> </span>creating duplicate report 
loops</h3><p style="--tw-space-y-reverse: 0; margin-block: 0px 16px; margin: 
6px 0px; word-break: break-word; color: rgba(228, 228, 228, 0.92); font-family: 
&quot;Segoe WPC&quot;, &quot;Segoe UI&quot;, sans-serif; font-size: 13px; 
font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; 
font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; 
text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; 
-webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(24, 
24, 24); text-decoration-thickness: initial; text-decoration-style: initial; 
text-decoration-
 color: initial;"><span class="font-semibold" data-streamdown="strong" 
style="--tw-font-weight: 600; font-weight: 600;">File:</span><span> </span><a 
href="https://github.com/songzhendong/skywalking-nodejs/blob/feature/nodejs-grpc-v1-review-fixes/src/agent/core/remote/TraceSegmentServiceClient.ts";
 target="_blank" rel="noopener noreferrer" style="text-decoration: rgb(129, 
161, 193); color: rgb(129, 161, 193); cursor: pointer; overflow-wrap: 
anywhere;"><code class="md-clickable-code md-inline-path-filename-like" 
role="button" tabindex="0" style="padding: 1.5px 4px; border-radius: 5px; 
background-color: color(srgb 0.894118 0.894118 0.894118 / 0.0737255); color: 
rgb(129, 161, 193); font-family: Consolas, &quot;Courier New&quot;, monospace; 
font-size: 0.9em; line-height: 1.4; word-break: break-all; cursor: 
pointer;"><span 
class="md-inline-path-filename">TraceSegmentServiceClient.ts</span></code></a></p><ul
 class="list-inside list-disc whitespace-normal [li_&amp;]:pl-6" 
data-streamdown="un
 ordered-list" style="--tw-space-y-reverse: 0; margin-block: 0px 16px; 
list-style-type: disc; white-space: normal; padding-left: 2em; display: flex 
!important; flex-direction: column !important; gap: 6px !important; margin: 6px 
0px !important; color: rgba(228, 228, 228, 0.92); font-family: &quot;Segoe 
WPC&quot;, &quot;Segoe UI&quot;, sans-serif; font-size: 13px; font-style: 
normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 
400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; 
text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 
0px; background-color: rgb(24, 24, 24); text-decoration-thickness: initial; 
text-decoration-style: initial; text-decoration-color: initial;"><li 
class="py-1 [&amp;&gt;p]:inline" data-streamdown="list-item" 
style="padding-block: 4px; word-break: break-word; padding: 0px 
!important;">Single scheduled timer via<span> </span><code class="" 
style="padding: 1.5px 4px; border-radius: 5px
 ; background-color: color(srgb 0.894118 0.894118 0.894118 / 0.0737255); color: 
color(srgb 0.894118 0.894118 0.894118 / 0.866275); font-family: Consolas, 
&quot;Courier New&quot;, monospace; font-size: 0.9em; line-height: 1.4; 
word-break: break-all;">scheduleNextReport()</code><span> </span>(no duplicate 
pending timeouts).</li><li class="py-1 [&amp;&gt;p]:inline" 
data-streamdown="list-item" style="padding-block: 4px; word-break: break-word; 
padding: 0px !important;">Single in-flight report via<span> </span><code 
class="" style="padding: 1.5px 4px; border-radius: 5px; background-color: 
color(srgb 0.894118 0.894118 0.894118 / 0.0737255); color: color(srgb 0.894118 
0.894118 0.894118 / 0.866275); font-family: Consolas, &quot;Courier New&quot;, 
monospace; font-size: 0.9em; line-height: 1.4; word-break: 
break-all;">reportOnce()</code><span> </span>+<span> </span><code class="" 
style="padding: 1.5px 4px; border-radius: 5px; background-color: color(srgb 
0.894118 0.894118 0.894118 / 0.0737
 255); color: color(srgb 0.894118 0.894118 0.894118 / 0.866275); font-family: 
Consolas, &quot;Courier New&quot;, monospace; font-size: 0.9em; line-height: 
1.4; word-break: break-all;">reporting</code><span> </span>lock.</li><li 
class="py-1 [&amp;&gt;p]:inline" data-streamdown="list-item" 
style="padding-block: 4px; word-break: break-word; padding: 0px 
!important;"><code class="" style="padding: 1.5px 4px; border-radius: 5px; 
background-color: color(srgb 0.894118 0.894118 0.894118 / 0.0737255); color: 
color(srgb 0.894118 0.894118 0.894118 / 0.866275); font-family: Consolas, 
&quot;Courier New&quot;, monospace; font-size: 0.9em; line-height: 1.4; 
word-break: break-all;">flush()</code><span> </span>clears any pending 
scheduled report before flushing.</li></ul><p style="--tw-space-y-reverse: 0; 
margin-block: 0px 16px; margin: 6px 0px; word-break: break-word; color: 
rgba(228, 228, 228, 0.92); font-family: &quot;Segoe WPC&quot;, &quot;Segoe 
UI&quot;, sans-serif; font-size: 13px; font-style
 : normal; font-variant-ligatures: normal; font-variant-caps: normal; 
font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; 
text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; 
-webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(24, 
24, 24); text-decoration-thickness: initial; text-decoration-style: initial; 
text-decoration-color: initial;"><span class="font-semibold" 
data-streamdown="strong" style="--tw-font-weight: 600; font-weight: 
600;">Follow-up in<span> </span><a 
href="https://github.com/songzhendong/skywalking-nodejs/commit/9755dd1"; 
target="_blank" rel="noopener noreferrer" style="text-decoration: none; color: 
rgb(129, 161, 193); cursor: pointer; overflow-wrap: anywhere;"><code class="" 
style="padding: 1.5px 4px; border-radius: 5px; background-color: color(srgb 
0.894118 0.894118 0.894118 / 0.0737255); color: color(srgb 0.894118 0.894118 
0.894118 / 0.866275); font-family: Consolas, &quot;Courier New&quot;, 
monospace; f
 ont-size: 0.9em; line-height: 1.4; word-break: 
break-all;">9755dd1</code></a>:</span></p><ul class="list-inside list-disc 
whitespace-normal [li_&amp;]:pl-6" data-streamdown="unordered-list" 
style="--tw-space-y-reverse: 0; margin-block: 0px 16px; list-style-type: disc; 
white-space: normal; padding-left: 2em; display: flex !important; 
flex-direction: column !important; gap: 6px !important; margin: 6px 0px 
!important; color: rgba(228, 228, 228, 0.92); font-family: &quot;Segoe 
WPC&quot;, &quot;Segoe UI&quot;, sans-serif; font-size: 13px; font-style: 
normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 
400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; 
text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 
0px; background-color: rgb(24, 24, 24); text-decoration-thickness: initial; 
text-decoration-style: initial; text-decoration-color: initial;"><li 
class="py-1 [&amp;&gt;p]:inline" data-streamdown="list-item" st
 yle="padding-block: 4px; word-break: break-word; padding: 0px 
!important;">After manual<span> </span><code class="" style="padding: 1.5px 
4px; border-radius: 5px; background-color: color(srgb 0.894118 0.894118 
0.894118 / 0.0737255); color: color(srgb 0.894118 0.894118 0.894118 / 
0.866275); font-family: Consolas, &quot;Courier New&quot;, monospace; 
font-size: 0.9em; line-height: 1.4; word-break: break-all;">flush()</code>, the 
1s report loop is restarted:<ul class="list-inside list-disc whitespace-normal 
[li_&amp;]:pl-6" data-streamdown="unordered-list" style="list-style-type: disc; 
white-space: normal; padding-left: 2em; display: flex !important; 
flex-direction: column !important; gap: 6px !important; margin: 6px 0px 0px 
!important;"><li class="py-1 [&amp;&gt;p]:inline" data-streamdown="list-item" 
style="padding-block: 4px; word-break: break-word; padding: 0px 
!important;">empty buffer →<span> </span><code class="" style="padding: 1.5px 
4px; border-radius: 5px; background-color:
  color(srgb 0.894118 0.894118 0.894118 / 0.0737255); color: color(srgb 
0.894118 0.894118 0.894118 / 0.866275); font-family: Consolas, &quot;Courier 
New&quot;, monospace; font-size: 0.9em; line-height: 1.4; word-break: 
break-all;">scheduleNextReport()</code>;</li><li class="py-1 
[&amp;&gt;p]:inline" data-streamdown="list-item" style="padding-block: 4px; 
word-break: break-word; padding: 0px !important;">data flushed →<span> 
</span><code class="" style="padding: 1.5px 4px; border-radius: 5px; 
background-color: color(srgb 0.894118 0.894118 0.894118 / 0.0737255); color: 
color(srgb 0.894118 0.894118 0.894118 / 0.866275); font-family: Consolas, 
&quot;Courier New&quot;, monospace; font-size: 0.9em; line-height: 1.4; 
word-break: break-all;">reportOnce().finally(() =&gt; 
scheduleNextReport())</code>.</li></ul></li></ul><p 
style="--tw-space-y-reverse: 0; margin-block: 0px 16px; margin: 6px 0px; 
word-break: break-word; color: rgba(228, 228, 228, 0.92); font-family: 
&quot;Segoe WPC&quot;, &qu
 ot;Segoe UI&quot;, sans-serif; font-size: 13px; font-style: normal; 
font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; 
letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; 
text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 
0px; white-space: normal; background-color: rgb(24, 24, 24); 
text-decoration-thickness: initial; text-decoration-style: initial; 
text-decoration-color: initial;"><span class="font-semibold" 
data-streamdown="strong" style="--tw-font-weight: 600; font-weight: 
600;">Also:</span><span> </span><a 
href="https://github.com/songzhendong/skywalking-nodejs/blob/feature/nodejs-grpc-v1-review-fixes/src/agent/core/meter/MeterSender.ts";
 target="_blank" rel="noopener noreferrer" style="text-decoration: rgb(129, 
161, 193); color: rgb(129, 161, 193); cursor: pointer; overflow-wrap: 
anywhere;"><code class="md-clickable-code md-inline-path-filename-like" 
role="button" tabindex="0" style="padding: 1.5px 4px; b
 order-radius: 5px; background-color: color(srgb 0.894118 0.894118 0.894118 / 
0.0737255); color: rgb(129, 161, 193); font-family: Consolas, &quot;Courier 
New&quot;, monospace; font-size: 0.9em; line-height: 1.4; word-break: 
break-all; cursor: pointer;"><span 
class="md-inline-path-filename">MeterSender.ts</span></code></a><span> </span>— 
shared in-flight<span> </span><code class="" style="padding: 1.5px 4px; 
border-radius: 5px; background-color: color(srgb 0.894118 0.894118 0.894118 / 
0.0737255); color: color(srgb 0.894118 0.894118 0.894118 / 0.866275); 
font-family: Consolas, &quot;Courier New&quot;, monospace; font-size: 0.9em; 
line-height: 1.4; word-break: break-all;">reporting</code><span> </span>promise 
so<span> </span><code class="" style="padding: 1.5px 4px; border-radius: 5px; 
background-color: color(srgb 0.894118 0.894118 0.894118 / 0.0737255); color: 
color(srgb 0.894118 0.894118 0.894118 / 0.866275); font-family: Consolas, 
&quot;Courier New&quot;, monospace; font-size: 
 0.9em; line-height: 1.4; word-break: break-all;">flush()</code><span> 
</span>and the periodic interval cannot run duplicate meter reports in 
parallel; reporting is gated on<span> </span><code class="" style="padding: 
1.5px 4px; border-radius: 5px; background-color: color(srgb 0.894118 0.894118 
0.894118 / 0.0737255); color: color(srgb 0.894118 0.894118 0.894118 / 
0.866275); font-family: Consolas, &quot;Courier New&quot;, monospace; 
font-size: 0.9em; line-height: 1.4; word-break: 
break-all;">CONNECTED</code><span> </span>and a live stub.</p><!--EndFragment-->
   </body>
   </html>Thank you for the detailed review. Your feedback on 
Node-agent-specific lifecycle and async behavior was extremely valuable. I have 
addressed all five issues you raised; the fixes are summarized below.
   
   Overview
   This update adds 2 commits on 
[feature/nodejs-grpc-v1-runtime-metrics](https://github.com/songzhendong/skywalking-nodejs/tree/feature/nodejs-grpc-v1-runtime-metrics):
   
   Commit       Description
   [78f92aa](https://github.com/songzhendong/skywalking-nodejs/commit/78f92aa)
   Core fixes for all review items
   [9755dd1](https://github.com/songzhendong/skywalking-nodejs/commit/9755dd1)
   Follow-up: restart the trace report loop after manual flush()
   Before updating this PR, I ran the full CI pipeline on my fork (Build / Test 
/ License) — all 34 checks passed.
   
   Fix details (5 items)
   1. Blocking — shutdown() and stale connectivity callbacks
   File: 
[GRPCChannelManager.ts](https://github.com/songzhendong/skywalking-nodejs/blob/feature/nodejs-grpc-v1-review-fixes/src/agent/core/remote/GRPCChannelManager.ts)
   
   Added an idempotent closed flag; reset on each boot().
   shutdown(): set closed, hold the current managed channel, clear the 
reference, then call shutdownNow().
   watchConnectivityState(): guard at entry (closed or no managed channel); 
inside the grpc-js callback, additionally verify closed and that 
this.managedChannel still matches the watched channel instance.
   Effect: after agent shutdown, stale connectivity watchers can no longer call 
getChannel() on a torn-down manager.
   
   2. High — heartbeat still using a stale client after disconnect
   File: 
[ServiceManagementClient.ts](https://github.com/songzhendong/skywalking-nodejs/blob/feature/nodejs-grpc-v1-review-fixes/src/agent/core/remote/ServiceManagementClient.ts)
   
   Maintain local connection status; create the heartbeat stub only on 
CONNECTED, destroy it on DISCONNECT.
   sendHeartbeat() runs only when status === CONNECTED and the management stub 
exists.
   Both reportInstanceProperties and keepAlive now use per-call deadlines 
(config.traceTimeout).
   3. High — reportError() was effectively a no-op
   File: 
[GRPCChannelManager.ts](https://github.com/songzhendong/skywalking-nodejs/blob/feature/nodejs-grpc-v1-review-fixes/src/agent/core/remote/GRPCChannelManager.ts)
   
   Reworked reportError():
   gRPC network errors (UNAVAILABLE, PERMISSION_DENIED, UNAUTHENTICATED, 
RESOURCE_EXHAUSTED, UNKNOWN) → notify(DISCONNECT), so periodic work stops 
immediately while grpc-js handles transport reconnect.
   Non-network errors → log only; no disconnect signal.
   4. Medium — Java-style busy-wait (GRPCStreamServiceStatus)
   Change: removed 
[GRPCStreamServiceStatus.ts](https://github.com/songzhendong/skywalking-nodejs/commit/78f92aa)
 (deleted in 78f92aa).
   
   Never used by Trace or Meter clients; dead code.
   No busy-wait blocking logic remains in agent core.
   5. Medium — flush() creating duplicate report loops
   File: 
[TraceSegmentServiceClient.ts](https://github.com/songzhendong/skywalking-nodejs/blob/feature/nodejs-grpc-v1-review-fixes/src/agent/core/remote/TraceSegmentServiceClient.ts)
   
   Single scheduled timer via scheduleNextReport() (no duplicate pending 
timeouts).
   Single in-flight report via reportOnce() + reporting lock.
   flush() clears any pending scheduled report before flushing.
   Follow-up in 
[9755dd1](https://github.com/songzhendong/skywalking-nodejs/commit/9755dd1):
   
   After manual flush(), the 1s report loop is restarted:
   empty buffer → scheduleNextReport();
   data flushed → reportOnce().finally(() => scheduleNextReport()).
   Also: 
[MeterSender.ts](https://github.com/songzhendong/skywalking-nodejs/blob/feature/nodejs-grpc-v1-review-fixes/src/agent/core/meter/MeterSender.ts)
 — shared in-flight reporting promise so flush() and the periodic interval 
cannot run duplicate meter reports in parallel; reporting is gated on CONNECTED 
and a live stub.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to