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

Fix arity error in :std/net/repl #1304

Merged
merged 4 commits into from
Feb 19, 2025

Conversation

nafarlee
Copy link
Contributor

Closes #1303

Copy link

netlify bot commented Feb 17, 2025

👷 Deploy request for elastic-ritchie-8f47f9 pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 42ee48d

Copy link
Collaborator

@vyzo vyzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you!

@vyzo
Copy link
Collaborator

vyzo commented Feb 17, 2025

seems CI is having one of these days...

@vyzo
Copy link
Collaborator

vyzo commented Feb 17, 2025

I think we need a timeout in the test.

@nafarlee
Copy link
Contributor Author

I think we need a timeout in the test.

Looking at the 6ish hours of hanging they did, I think you might be right 😅

According to the logs, the test never left setup, which I assume corresponds to test-setup!. Is the request to change it to something like...

(thread-join! (start-repl-server!) 10)

...just to ensure it would crash rather than hang for so long, or are you gesturing to something "corrective" we can do with a timeout (I don't know, like a retry or something)?

Apologies for what might be a basic question.

@vyzo
Copy link
Collaborator

vyzo commented Feb 17, 2025

oh it needs to run in a separate thread.
Try (thread-join! (spawn start-repl-server! ...))

I will cancel the workflows in the meantime.

Edit: see comment below, just spawn it.
Or does start-repl-server already spawn? I dont remember, check the code.

@vyzo
Copy link
Collaborator

vyzo commented Feb 17, 2025

ah they already failed.

Speaking of which we should add a timeout to gxtest, care for a pr?

@vyzo
Copy link
Collaborator

vyzo commented Feb 17, 2025

Ah dont join i setip, it will hang.

Instead spawn the thread, keep a ref and stop it at clran up.

@vyzo
Copy link
Collaborator

vyzo commented Feb 17, 2025

Ah dont join i setup, it will hang.

Instead spawn the thread, keep a ref and stop it at clean up.

@nafarlee
Copy link
Contributor Author

I thought start-repl-server! already spawned a thread internally, so it wasn't necessary to spawn the call to start-repl-server! itself?

@vyzo
Copy link
Collaborator

vyzo commented Feb 17, 2025

yes yes, it does

@nafarlee
Copy link
Contributor Author

Ah dont join i setup, it will hang.

Instead spawn the thread, keep a ref and stop it at clean up.

Given that start-repl-server! spawns internally, I thought this was functionally what the test was doing already, but I could be mistaken.

I still haven't been able to build master, but this test runs successfully on v0.18.1 locally. Either:

  • Something changed since v0.18.1 to cause this to hang
  • My local environment is somehow invalid

Given my build issues, I am assuming the latter. Tomorrow, I will try to build my changes on top of master in the Docker image to see if I can get a more authentic testing environment.

@vyzo
Copy link
Collaborator

vyzo commented Feb 18, 2025

Yes, but you cant block in test-setup. Joining the thread blocks.

@nafarlee
Copy link
Contributor Author

nafarlee commented Feb 19, 2025

Okay, I think I figured out the issue. For the short story, you can probably just look at the diff... 42ee48d

For the full explanation, I was finally able to get access to a master + my patch build of gerbil thanks to the docker build instructions. For some reason when I was testing my local build of [email protected], a final return was not necessary for the network REPL session to start executing a command. On the docker build of master, the return was indeed necessary.

The 6 hours of hanging was not due to a threading issue per se, but because read-line was waiting for a newline on the port that would never come: all that was in there was > because no command had executed.

If you want, I could add a timeout to this test to prevent read-line from hanging indefinitely in the future...but as you indicated in an earlier comment, I do personally think "test timeout" functionality is better integrated into gxtest itself.

@vyzo
Copy link
Collaborator

vyzo commented Feb 19, 2025

yrs, agreed, the proper solution is to add a --timeout option to gxtest.

Copy link
Collaborator

@vyzo vyzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you!

@vyzo vyzo merged commit 33c84ae into mighty-gerbils:master Feb 19, 2025
4 checks passed
@nafarlee nafarlee deleted the bug-net-repl-arity-error branch February 21, 2025 02:46
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.

Arity error when running :std/net/repl start-repl-server! on newer Gambit
2 participants