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

Inconsistent display of stdout #13

Open
JoshOrndorff opened this issue Jun 1, 2018 · 10 comments
Open

Inconsistent display of stdout #13

JoshOrndorff opened this issue Jun 1, 2018 · 10 comments

Comments

@JoshOrndorff
Copy link

The "output" section does not consistently display the names sent to stdout and stdoutAck.

If I load the site and click run I usually see the expected output

@{"Hello"}
@{"Joe"}

But sometimes I get none of the output, or only some of it. Running the example code three to five times will usually produce at least one incorrect output.

See the attached screenshot.
screenshot from 2018-06-01 15-07-58

@tschoffelen
Copy link
Contributor

I've noticed this as well. Root of this problem is in the fact that stdout results are outputted in the node's tty, not the one of the client. So what we do is we capture the output of the node process for a little while until the client exists.

Sometimes that timing apparently doesn't line up correctly, and I don't really know what causes that at the moment.

@JoshOrndorff
Copy link
Author

That root behavior hasn't changed in 0.4.1.

Do you spin up a now node container for every request sent? If so would capturing the output for a little while longer help?

If it's the same node for all requests is there a chance that my output will step on someone else's if we submit requests at the same time?

@tschoffelen
Copy link
Contributor

It uses the same node (actually one of 5 load balanced nodes at the moment) as you already realised in #14 I believe.

Spinning up a new node would be way too slow, since it has a startup time of anywhere between 15-30 seconds, plus nodes currently use quite a lot of compute resources, so for the amount of users we currently have that isn't quite an option.

Capturing the output for slightly longer might already resolve part of the problem indeed, and I hope that as the RNode versions progress there might be more consistency in the moment and way that stdout output works.

@dckc
Copy link

dckc commented Jul 3, 2018

What about spinning up a new node every night or every hour?

And display the node start time.

@dckc
Copy link

dckc commented Jul 3, 2018

Or adding a "restart node" button?

(with a limitation that it can't be used again for 5 minutes)

@tschoffelen
Copy link
Contributor

True, that would work, or even after X requests. With the load balancer in place, we could even take that node temporarily out of rotation for use on rchain.cloud.

Currently really busy, but will try to implement something like this in the next few weeks. Thanks for the input @dckc and @JoshOrndorff!

@8lcarte
Copy link

8lcarte commented Jul 10, 2018

I'm also having this problem. After changing my message it reverts to my old messages.

-Lee [``]([url](url
screen shot 2018-07-10 at 10 10 43 am
))

@JoshOrndorff
Copy link
Author

What if you capture and display both stdout and stderr. Users who really want their output clearly can send it to stderr so it doesn't conflict with the other stuff coming on stdout.

Not a bad workaround in the meantime.

@tschoffelen
Copy link
Contributor

I think this is only a display problem. In a later stage we might decide to indeed capture stdout and stderr separately. I think our current way of capturing output from the node doesn't differentiate between those types.

Since this issue was opened, however, we've made quite some improvements, and while still not 100% consistent, this seems to be less of a problem then it was before. Feel free to close this issue once it's at a point where you consider it acceptable.

@tschoffelen
Copy link
Contributor

tschoffelen commented Sep 21, 2018

@8lcarte the thing you're flagging is slightly different from @JoshOrndorff original issue. Your Rholang code should look like this to work as you expect it to:

new coffeeShop {
	contract coffeeShop(order) = {
		stdout!("Hello!")
	} |
	coffeeShop!("Something")
}

In my (simplified) version of your example, coffeeShop is only defined in the scope of the new statement, so it's a different channel every time you execute the code, whereas with your version, you're using the same channel.

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

No branches or pull requests

4 participants