Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optionally skip node creation #26

Closed
wants to merge 1 commit into from
Closed

optionally skip node creation #26

wants to merge 1 commit into from

Conversation

fippo
Copy link
Member

@fippo fippo commented Oct 13, 2014

had to make it work with already created nodes.

@emcho
Copy link
Member

emcho commented Oct 13, 2014

Why does this need to be a configuration option? Wouldn't it be better to simply check if the node is there and automatically skip creation if it isn't?

@fippo
Copy link
Member Author

fippo commented Oct 13, 2014

well, you could test by creating a node... but that still gives way to many ways to shoot yourself in the foot. FWIW, sane xmpp servers have autocreate options :-)

@emcho
Copy link
Member

emcho commented Oct 13, 2014

Is this the only way to check? How about subscribing? Also why would a tentative create mean you are shooting yourself in the foot? Could you please be more specific?

@emcho
Copy link
Member

emcho commented Oct 13, 2014

oh and by the way, please make sure you are not going beyond column 80.
https://jitsi.org/codeconvention

@fippo
Copy link
Member Author

fippo commented Oct 13, 2014

my node is configured already, so trying to create it will fail (with a forbidden error I think -- conflict is handled but prosody returns a different error so the current strategy is not sufficient).

will fix the 80.

@emcho
Copy link
Member

emcho commented Oct 13, 2014

So you are basically saying that there is no reliable standard way in XMPP to query for an existing pubsub node?

@emcho
Copy link
Member

emcho commented Oct 13, 2014

Like this for instance:

http://xmpp.org/extensions/xep-0060.html#entity-nodes

@fippo
Copy link
Member Author

fippo commented Oct 13, 2014

Sure, that's just way more complicated. Unless you want to have a flow like create+fail+publish-anyway+get-rejected.

Assuming you have to create a node before being able to publish to it is not covered by xep-0060 afaics.

@emcho
Copy link
Member

emcho commented Oct 13, 2014

See my previous comment. Why would disco not work?

Also, why would you need a flow like this "create+fail+publish-anyway+get-rejected". Why would you get rejected?

@fippo
Copy link
Member Author

fippo commented Oct 13, 2014

(1) How many hierarchies of node collections do you want to support? Also, I would note that currently there is no service discovery as described in http://xmpp.org/extensions/xep-0060.html#entity-features to figure out whether the jid published to is a pubsub service.

(2) because the current assumption that you can publish when you fail with a conflict error is wrong / not covered by the spec.

@emcho
Copy link
Member

emcho commented Oct 13, 2014

(1) How many hierarchies of node collections do you want to support?

As many as there are in the configuration option.

Also, I would note that currently
there is no service discovery as described in http://xmpp.org/extensions/xep-0060.html#entity-
features to figure out whether the jid published to is a pubsub service.

You mean prosody does not support this?

(2) because the current assumption that you can publish when you fail with a conflict error
is wrong / not covered by the spec.

The assumption is that if you are configured with a specific room then you can either create it or it would turn out that it exists in which case you should be able to publish. If that is impossible, then the deployer has an issue and they need to be notified about it.

I am probably missing something but I don't see how this patch has anything to do with this case. It basically spares you the need to attempt creation and the only benefit of that is a single RTT for the entire lifecycle of a bridge instance. One would still need to handle the case where a messages can be rejected. The deployer would still have to be notified about a misconfiguration.

@fippo
Copy link
Member Author

fippo commented Oct 13, 2014

(2) I don't know. Nor do I care. I'd note that (5.1) discovery is currently not done by the JVB pubsub publisher. Given that it is a single RTT for the entire lifetime I presume that's a bug?
Once that is done it would probably be good to also have the full process of discovering whether the publisher is an owner as described in section 5.4. I'd note that, like node creation, this is not a required precondition.

(3) your assumption seems to be that being able to create a node is a precondition to publishing. This is wrong. My node owners JID is different from the JVB, however I have allowed the JVB to publish to that node by granting it publisher rights. The JVB might NOT be allowed to create its own nodes on my pubsub server for security reasons (such as restricting creation to local jids or admins).
Did you notice that this doesn't change the current default behaviour but makes an override configurable?

@emcho
Copy link
Member

emcho commented Oct 13, 2014

(2) I don't know. Nor do I care.

Well ... I do.

I'd note that (5.1) discovery is
currently not done by the JVB pubsub publisher. Given that it is a
single RTT for the entire lifetime I presume that's a bug? Once that
is done it would probably be good to also have the full process of
discovering whether the publisher is an owner as described in section
5.4. I'd note that, like node creation, this is not a required
precondition.

Sounds good.

(3) your assumption seems to be that being able to create a node is a
precondition to publishing.

Not at all. My assumption is that trying to create the node can do no hard but still do good.

This is wrong.

Yes, of course.

My node owners JID is
different from the JVB, however I have allowed the JVB to publish to
that node by granting it publisher rights. The JVB might NOT be
allowed to create its own nodes on my pubsub server for security
reasons (such as restricting creation to local jids or admins).

Agreed!

Did you notice that this doesn't change the current default behaviour but
makes an override configurable?

Yes, sure. The point is that if something doesn't absolutely require a configuration option, there shouldn't be one. I am asking my question again: why is it a problem for you if the bridge does a failed attempt to create a room every time it starts? Are you trying to save the extra RTT during startup?

@fippo
Copy link
Member Author

fippo commented Oct 13, 2014

because my pubsub service doesn't allow node creation by non-local entities (well, it might). Also, I am letting multiple bridges publish their stats to the same pubsub node that acts as an aggregator. How many more usecases do you need?

why is it a problem for you if the bridge does a failed attempt to create a room every time it starts?

Because the bridge's currently is to give up when it can't create the node. We can agree this is a bug because of that invalid assumption that node-creation is a precondition to publish.

@emcho
Copy link
Member

emcho commented Oct 13, 2014

because my pubsub service doesn't allow node creation by non-local
entities (well, it might).

Not a problem!

Also, I am letting multiple bridges
publish their stats to the same pubsub node that acts as an
aggregator.

Not a problem either!

How many more usecases do you need?

One?

why is it a problem for you if the bridge does a failed attempt to
create a room every time it starts?
Because the bridge's currently is
to give up when it can't create the node.

And that's something I can certainly agree would need fixing.

@fippo
Copy link
Member Author

fippo commented Oct 13, 2014

"Not a problem!"
-- well, it won't reply with a conflict error in that case, so https://github.com/jitsi/jitsi-videobridge/blob/master/src/org/jitsi/videobridge/pubsub/PubSubPublisher.java#L322 wont work.

"Not a problem either!"
No conflict error either.

"And that's something I can certainly agree would need fixing."
The thing that needs to be fixed is the assumption that publication always needs creation.
Some smart servers will actually create a node if you publish to it. Not all of them though I think. So having a way to avoid creation is good while keeping an easy-to-use default that works for most simple usecases.

@emcho
Copy link
Member

emcho commented Oct 13, 2014

"Not a problem!"
-- well, it won't reply with a conflict error in that case, so
https://github.com/jitsi/jitsi-videobridge/blob/master/src/org/jitsi/videobridge/pubsub/PubSubPublisher.java#L322
wont work.

Indeed. Not with the current implementation.

"And that's something I can certainly agree would need fixing."
The
thing that needs to be fixed is the assumption that publication needs
creation. Some smart servers will actually create a node if you
publish to it. Not all of them though I think.

I think you are trying to say that we should handle the case where servers return other errors than "CONFLICT" in case of an existing room and I already agreed this needs to be addressed.

In other words, to make it clearer, I am not disagreeing there's a problem to be fixed here. I just don't think it should be addressed with a config option.

@fippo fippo closed this Oct 13, 2014
@bgrozev bgrozev mentioned this pull request Oct 14, 2014
bbaldino pushed a commit to bbaldino/jitsi-videobridge that referenced this pull request Jan 22, 2020
bbaldino pushed a commit to bbaldino/jitsi-videobridge that referenced this pull request Sep 24, 2020
JonathanLennox pushed a commit to JonathanLennox/jitsi-videobridge that referenced this pull request Jun 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants