edts
edts copied to clipboard
Running EDTS when there are more than one user on the same host
Hi,
Has anyone had any experience with EDTS on a multi-user system, i.e. a host where more than one user is logged in (and using EDTS) at the same time?
I'm thinking of adapting EDTS and avoid hardcoding the HTTP port as well as the erlang node names (edts,
Cheers, Klas
Hi,
I haven't heard of anyone using EDTS in that way so far. The node names for the project nodes are already configurable but if you would like to make the central EDTS node name configurable as well I wouldn't mind :)
Thanks Thomas.
When you say the node names are configurable, do you mean through the .edts file? All users will clone the same repo with the same .edts file. I have written some not-yet-production-ready code which adds "--$USER" as a suffix to all node names (edts,
If there's some other way of configuring the node names dynamically that I've missed, I'd be happy to hear.
Would it be acceptable to make that the default behaviour, or should I try to make it configurable through an option?
I haven't found a good way of not hardcoding the 4587 port number yet. I've started mochiweb on port number 0 --> it'll start on an available port. Not sure how to communicate that back to the elisp side yet. I've considered letting the erlang side write some file that the elisp side could read. Or, letting the erlang side write something to stdout that the elisp side could read. Neither feels spot on.
Will be doing some more thinking. Any ideas are welcome.
Cheers, Klas
There is a variable called edts-project-overrides that you can use to override the project attributes specified by the .edts file. $USER may contain characters that are not valid for erlang node names, but if you manage to filter those out I guess we could have an option to suffix node names with it. I wouldn't do it by default.
Disregarding the miniscule probability of a race condition, it should be possible to have EDTS scan availble ports and choose one to use for mochiweb.
I'd just like to feed back to this thread. I've personally given this low prio for time being. The issue still exists for us, but I'm hoping it'll eventually go away. I'm putting it on hold for a while and see how things evolve.
I'm trying to get my coworkers up and running, and we are on a multi-user host. Most of us work in different project areas. Only one of us can open EDTS, because all other users tries to connect the edts@hostname node that the first user opened. klajo, how far did you got on changing node-names? Can you please merge/post/show your solution?
Sorry, I don't have anything to share. Just experimented with it, but didn't keep the changes.
Having thought about it I think you can actually accomplish this with very small changes to EDTS. You need a set of two ports that don't collide with your colleagues'.
The first one is the epmd port and that can be accomplished by simply setting the ERL_EPMD_PORT environment variable.
The second one is the EDTS REST-API port. The only change required to accomplish that would be to make the EDTS main server start script take the REST API port as a parameter and send in the value of edts-rest-port
when starting up the server.
Yes, this worked! :+1:
I will investigate if it is possible to start mochiweb on port 0 and then communicate that to elisp as klajo suggested, or maybe I just create a port.conf file so we don't have to recompile all files between tries.
Edit: Another idea is to add a username suffix to the edts-node, then you would probably not need to set the epmd port.
please reopen if still an issue