Commit 59800f6
authored
[cuebot] Fix channel closing issue (#2274)
The application os not properly closing the grpc channel at shutdown,
leaving this SEVERE warning:
```
Channel ManagedChannelImpl{logId=2787, target=elk0815:8444} was not shutdown properly
```
Explanation:
`RqdClientGrpc`
(cuebot/src/main/java/com/imageworks/spcue/rqd/RqdClientGrpc.java:71-89)
holds a Guava `LoadingCache<String, ManagedChannel>`. The
`removalListener` calls `conn.shutdown()` **on cache eviction** — but
never on application shutdown. The bean has no `destroy-method`
(applicationContext-service.xml:39, no destroy hook), and
`RqdClientGrpc` has no `shutdown()` method at all. So when cuebot stops:
- The cache is GC'd
- Each `ManagedChannel` is finalized **without** `shutdown()` having
been called
- gRPC logs `SEVERE: Channel ... was not shutdown properly!!!` per
leaked channel, with the stack capturing where the channel was first
allocated (the `RuntimeException: ManagedChannel allocation site` —
that's a diagnostic stack, not a real exception)
## LLM usage disclosure
Claude Opus was used for investigating the origin of the log and
proposing a fix
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Bug Fixes**
* Improved application shutdown procedure to properly clean up network
resources and prevent potential resource leaks during shutdown.
* Enhanced shutdown sequencing to ensure proper initialization and
cleanup order of internal services.
[](https://app.coderabbit.ai/change-stack/AcademySoftwareFoundation/OpenCue/pull/2274)
<!-- end of auto-generated comment: release notes by coderabbit.ai -->1 parent 21fc1af commit 59800f6
2 files changed
Lines changed: 13 additions & 6 deletions
File tree
- cuebot/src/main
- java/com/imageworks/spcue/rqd
- resources/conf/spring
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
219 | 226 | | |
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
| 88 | + | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
| 110 | + | |
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
| 131 | + | |
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
| 143 | + | |
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| |||
0 commit comments