Skip to content

Commit b31d706

Browse files
committed
job-info: cleanup update lookups on disconnect
Problem: On disconnect, cleaning up update-lookups was forgotten. Add cleanup update_lookups via a new update_lookup_cleanup() function.
1 parent a43f24f commit b31d706

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

src/modules/job-info/job-info.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,10 @@ static void info_ctx_destroy (struct info_ctx *ctx)
117117
guest_watch_cleanup (ctx);
118118
zlist_destroy (&ctx->guest_watchers);
119119
}
120-
if (ctx->update_lookups)
120+
if (ctx->update_lookups) {
121+
update_lookup_cleanup (ctx);
121122
zlist_destroy (&ctx->update_lookups);
123+
}
122124
if (ctx->update_watchers) {
123125
update_watch_cleanup (ctx);
124126
zlist_destroy (&ctx->update_watchers);

src/modules/job-info/update.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -689,6 +689,23 @@ void update_watch_cleanup (struct info_ctx *ctx)
689689
}
690690
}
691691

692+
void update_lookup_cleanup (struct info_ctx *ctx)
693+
{
694+
struct update_ctx *uc;
695+
696+
while ((uc = zlist_pop (ctx->update_lookups))) {
697+
const flux_msg_t *msg;
698+
msg = flux_msglist_first (uc->msglist);
699+
while (msg) {
700+
if (flux_respond_error (ctx->h, msg, ENOSYS, NULL) < 0)
701+
flux_log_error (ctx->h, "%s: flux_respond_error",
702+
__FUNCTION__);
703+
msg = flux_msglist_next (uc->msglist);
704+
}
705+
update_ctx_destroy (uc);
706+
}
707+
}
708+
692709
int update_watch_count (struct info_ctx *ctx)
693710
{
694711
struct update_ctx *uc;

src/modules/job-info/update.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ void update_watchers_cancel (struct info_ctx *ctx,
3232

3333
void update_watch_cleanup (struct info_ctx *ctx);
3434

35+
void update_lookup_cleanup (struct info_ctx *ctx);
36+
3537
int update_watch_count (struct info_ctx *ctx);
3638

3739
#endif /* ! _FLUX_JOB_INFO_UPDATE_H */

0 commit comments

Comments
 (0)