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

feat(HandledPromise): add unwrap method to allow sync access to presences #413

Merged
merged 2 commits into from
Jan 27, 2020

Conversation

michaelfig
Copy link
Member

Closes #412

The new HandledPromise.unwrap(p) synchronously returns p if it is a presence, or the presence corresponding to the HandledPromise p that was fulfilled with resolveWithPresence.

If no synchronous presence can be found, unwrap throws a TypeError.

@michaelfig michaelfig added the eventual-send package: eventual-send label Jan 13, 2020
@michaelfig
Copy link
Member Author

Renamed from antiResolve in Agoric/eventual-send#24

Copy link
Member

@erights erights left a comment

Choose a reason for hiding this comment

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

LGTM

@michaelfig
Copy link
Member Author

@dckc can you give any hints as to why the eventual-send xs test suite is failing?

@michaelfig
Copy link
Member Author

@dckc can you give any hints as to why the eventual-send xs test suite is failing?

Specifically,

# cc eventual-send
**
GLib:ERROR:../../../../glib/ghash.c:377:g_hash_table_lookup_node: assertion failed: (hash_table->ref_count > 0)
/home/runner/work/_temp/b8a7edd6-dfb4-489e-9abb-e43ffb2efec0.sh: line 7:  3176 Aborted                 (core dumped) $MODDABLE/build/bin/lin/release/eventual-send
##[error]Process completed with exit code 134.

@dckc
Copy link
Member

dckc commented Jan 22, 2020

Those symptoms look vaguely familiar, but I don't recall the diagnosis nor treatment.

I moved away from running the eventual-send tests that way as of Jan 18
dckc@799d82a#diff-de1df6d3a0175ca0f98d344f02455a96

@michaelfig
Copy link
Member Author

I moved away from running the eventual-send tests that way as of Jan 18

Would you be able to make (or point me to) a PR that does the eventual-send tests the new way? I will gladly merge those changes, and try this .unwrap PR again. I just want to make sure I'm not regressing with .unwrap.

@dckc
Copy link
Member

dckc commented Jan 22, 2020

Would you be able to make (or point me to) a PR that does the eventual-send tests the new way? I will gladly merge those changes, and try this .unwrap PR again.

I have dckc#1 but it's a monster at +4,429 −1,317 with code of varying quality. When I moved away from running the tests for the eventual-send package, I moved to running the tests for the SwingSet package, and the changes to get it to work were substantial.

I just want to make sure I'm not regressing with .unwrap.

To diagnose the failure, I would probably try a debug build. Where the automated build does mcconfig -m -p x-cli-lin test-xs-manifest.json, try mcconfig -m -p lin -d test-xs-manifest.json instead, while you have xsbug running. Failing that, gdb works the x-cli-lin executables as susual; sometimes it's even helpful on on non-debug builds.

Unfortunately, a hash table lookup failure can be far from the source of the problem where the hash table was put in a corrupted state in the first place.

Perhaps send me a calendar invite for a time when I can show you how I debug such things?

@michaelfig
Copy link
Member Author

The failing xs test passes with the change in agoric-labs/tape-xs#4

@michaelfig michaelfig force-pushed the 412-unwrap-presence branch 4 times, most recently from ab49115 to d755832 Compare January 27, 2020 16:55
@michaelfig michaelfig merged commit ad24880 into master Jan 27, 2020
@michaelfig michaelfig deleted the 412-unwrap-presence branch January 27, 2020 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
eventual-send package: eventual-send
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HandledPromise.unwrap(p) to synchronously get the presence
3 participants