Skip to content

Conversation

@yim-lee
Copy link
Member

@yim-lee yim-lee commented Jul 7, 2020

Motivation:
See #720

Modifications:
Add defaultValue to ORMap proto so it's included in serialization
and deserialized ORMap would have defaultValue set.

Add test to reproduce error and verify fix.

Result:
No fatal error when gossiping ORMap. Resolves #720

Motivation:
See #720

Modifications:
Add `defaultValue` to `ORMap` proto so it's included in serialization
and deserialized `ORMap` would have `defaultValue` set.

Add test to reproduce error and verify fix.

Result:
No fatal error when gossiping `ORMap`. Resolves #720
@yim-lee
Copy link
Member Author

yim-lee commented Jul 7, 2020

An occurrence of #712 and new test:

error: CRDTGossipReplicationClusteredTests.test_gossip_localLWWMapUpdate_toOtherNode : threw error "No result within 10s for block at /code/Tests/DistributedActorsTests/CRDT/CRDTGossipReplicationClusteredTests.swift:287. Queried 1 times, within 10s. Last error: 
        try self.expectMap(probe: p2, expected: ["a": "foo", "aa": .none])
                                                                    �[0;31m^~~~~~~~~~~~~~
error: Did not receive message of type [LWWMap<String, Optional<String>>] within [10s], error: noMessagesInQueue�[0;0m"

5.3 build passes fine though.

@swift-server-bot test this please

@yim-lee yim-lee requested a review from ktoso July 8, 2020 00:18
@yim-lee
Copy link
Member Author

yim-lee commented Jul 8, 2020

Don't know why the new test keeps failing in 5.2 but not 5.3.

17:06:51 Captured log [first][2020-07-08 0:6:38.2960] [Gossiper+Shell.swift:257][/system/replicator/gossip] [warning] Failed to ACK delivery [lwwmap] gossip CRDT.Gossip(LWWMap<String, Optional<String>>(["a": Optional("foo"), "aa": nil])) to ActorRef<GossipShell<DistributedActors.CRDT.Gossip, DistributedActors.CRDT.GossipAck>.Message>(sact://second@127.0.0.1:9002/system/replicator/gossip)

@ktoso
Copy link
Member

ktoso commented Jul 8, 2020

Error logging works but we too aggressively silenced logs in the test's config: 3acc55a#diff-4d7d98ce09adef77b7a83ff0541b8456L23-L25

Going to now view the error on 5.2

@ktoso
Copy link
Member

ktoso commented Jul 8, 2020

Summary so far: it's about the Swift 5.2 foundation not doing .fragmentsAllowed which causes: Top-level ... encoded as null JSON fragment. whenever a Value is a "not object" (so arrays, ints/doubles, strings). Working around this is somewhat insane with manually parsing the sspecific cases...

The problem only exists on 5.2.4 only on linux (!), and is solved on macos and; on both platforms from swift 5.3...

@yim-lee
Copy link
Member Author

yim-lee commented Jul 8, 2020

Tracking top-level JSON serialization issue with #729

@yim-lee
Copy link
Member Author

yim-lee commented Jul 8, 2020

Taking care of ORMap issue with #722

@yim-lee yim-lee closed this Jul 8, 2020
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.

CRDT.ORMap serialization failure during gossip

2 participants