Skip to content

Commit 60fd717

Browse files
committed
broker: drop overlay_msg_is_local()
Problem: overlay_msg_is_local() is no longer used with the advent of flux_msg_is_local(). Drop the internal broker function overlay_msg_is_local(), and convert its unit tests to use flux_msg_is_local().
1 parent 4bcb9e5 commit 60fd717

File tree

3 files changed

+10
-37
lines changed

3 files changed

+10
-37
lines changed

src/broker/overlay.c

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -454,14 +454,6 @@ static struct child *child_lookup (struct overlay *ov, const char *id)
454454
return NULL;
455455
}
456456

457-
bool overlay_msg_is_local (const flux_msg_t *msg)
458-
{
459-
/* Return true only if msg is non-NULL and the message does not
460-
* have the overlay supplied "remote" tag.
461-
*/
462-
return (msg && flux_msg_aux_get (msg, "overlay::remote") == NULL);
463-
}
464-
465457
/* Lookup (direct) child peer by rank.
466458
* Returns NULL on lookup failure.
467459
*/
@@ -899,13 +891,6 @@ static void child_cb (flux_reactor_t *r, flux_watcher_t *w,
899891
logdrop (ov, OVERLAY_DOWNSTREAM, msg, "failed to clear local role");
900892
goto done;
901893
}
902-
/* Flag this message as remotely received. This allows efficient
903-
* operation of the overlay_msg_is_local() function.
904-
*/
905-
if (flux_msg_aux_set (msg, "overlay::remote", int2ptr (1), NULL) < 0) {
906-
logdrop (ov, OVERLAY_DOWNSTREAM, msg, "failed to tag msg as remote");
907-
goto done;
908-
}
909894
if (flux_msg_get_type (msg, &type) < 0
910895
|| !(uuid = flux_msg_route_last (msg))) {
911896
logdrop (ov, OVERLAY_DOWNSTREAM, msg, "malformed message");
@@ -1012,13 +997,6 @@ static void parent_cb (flux_reactor_t *r, flux_watcher_t *w,
1012997
logdrop (ov, OVERLAY_UPSTREAM, msg, "failed to clear local role");
1013998
goto done;
1014999
}
1015-
/* Flag this message as remotely received. This allows efficient
1016-
* operation of the overlay_msg_is_local() function.
1017-
*/
1018-
if (flux_msg_aux_set (msg, "overlay::remote", int2ptr (1), NULL) < 0) {
1019-
logdrop (ov, OVERLAY_UPSTREAM, msg, "failed to tag msg as remote");
1020-
goto done;
1021-
}
10221000
if (flux_msg_get_type (msg, &type) < 0) {
10231001
logdrop (ov, OVERLAY_UPSTREAM, msg, "malformed message");
10241002
goto done;

src/broker/overlay.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,6 @@ int overlay_set_monitor_cb (struct overlay *ov,
142142
*/
143143
int overlay_register_attrs (struct overlay *overlay);
144144

145-
/* Return true if this message was routed locally, i.e. wasn't delivered
146-
* via an overlay parent or child.
147-
*/
148-
bool overlay_msg_is_local (const flux_msg_t *msg);
149-
150145
/* Stop allowing new connections from downstream peers.
151146
*/
152147
void overlay_shutdown (struct overlay *overlay);

src/broker/test/overlay.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -330,8 +330,8 @@ void trio (flux_t *h)
330330
rmsg = recvmsg_timeout (ctx[0], 5);
331331
ok (rmsg != NULL,
332332
"%s: request was received by overlay", ctx[0]->name);
333-
ok (!overlay_msg_is_local (rmsg),
334-
"%s: overlay_msg_is_local fails on parent from child",
333+
ok (!flux_msg_is_local (rmsg),
334+
"%s: flux_msg_is_local fails on parent from child",
335335
ctx[1]->name);
336336
ok (flux_msg_get_topic (rmsg, &topic) == 0 && !strcmp (topic, "meep"),
337337
"%s: received message has expected topic", ctx[0]->name);
@@ -354,8 +354,8 @@ void trio (flux_t *h)
354354
rmsg = recvmsg_timeout (ctx[1], 5);
355355
ok (rmsg != NULL,
356356
"%s: request was received by overlay", ctx[1]->name);
357-
ok (!overlay_msg_is_local (rmsg),
358-
"%s: overlay_msg_is_local fails on child from parent",
357+
ok (!flux_msg_is_local (rmsg),
358+
"%s: flux_msg_is_local fails on child from parent",
359359
ctx[1]->name);
360360
ok (flux_msg_get_topic (rmsg, &topic) == 0 && !strcmp (topic, "errr"),
361361
"%s: request has expected topic", ctx[1]->name);
@@ -376,8 +376,8 @@ void trio (flux_t *h)
376376
rmsg = recvmsg_timeout (ctx[0], 5);
377377
ok (rmsg != NULL,
378378
"%s: response was received by overlay", ctx[0]->name);
379-
ok (!overlay_msg_is_local (rmsg),
380-
"%s: overlay_msg_is_local returns false for response from child");
379+
ok (!flux_msg_is_local (rmsg),
380+
"%s: flux_msg_is_local returns false for response from child");
381381
ok (flux_msg_get_topic (rmsg, &topic) == 0 && !strcmp (topic, "m000"),
382382
"%s: received message has expected topic", ctx[0]->name);
383383
ok (flux_msg_route_count (rmsg) == 0,
@@ -396,8 +396,8 @@ void trio (flux_t *h)
396396
"%s: event was received by overlay", ctx[0]->name);
397397
ok (flux_msg_get_topic (rmsg, &topic) == 0 && !strcmp (topic, "eeek"),
398398
"%s: received message has expected topic", ctx[0]->name);
399-
ok (!overlay_msg_is_local (rmsg),
400-
"%s: overlay_msg_is_local returns false for event from child");
399+
ok (!flux_msg_is_local (rmsg),
400+
"%s: flux_msg_is_local returns false for event from child");
401401

402402
/* Response 0->1
403403
*/
@@ -664,8 +664,8 @@ void wrongness (flux_t *h)
664664
ok (overlay_bind (ov, "ipc://@foobar") < 0 && errno == EINVAL,
665665
"overlay_bind fails if called before rank is known");
666666

667-
ok (!overlay_msg_is_local (NULL),
668-
"overlay_msg_is_local (NULL) returns false");
667+
ok (!flux_msg_is_local (NULL),
668+
"flux_msg_is_local (NULL) returns false");
669669

670670
overlay_destroy (ov);
671671
attr_destroy (attrs);

0 commit comments

Comments
 (0)