Skip to content

Commit

Permalink
use concurrency safe primitive. (#11404)
Browse files Browse the repository at this point in the history
Related to https://airbytehq-team.slack.com/archives/C03AS1GAQV6/p1708704237474249.

I believe this is why we are throwing an error.

Note that Java doesn't provide a concurrency safe Hashset out of the box. The general recommendation is to use the Concurrent Hashmap Key set.
  • Loading branch information
davinchia committed Feb 23, 2024
1 parent c0ec94b commit cf4f1a5
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ private void validateSchemaUncounted(final AirbyteMessage message) {
recordSchemaValidator.validateSchemaWithoutCounting(record, messageStream, uncountedValidationErrors);
final Set<String> unexpectedFieldNames = getUnexpectedFieldNames(record, streamToAllFields.get(messageStream));
if (!unexpectedFieldNames.isEmpty()) {
unexpectedFields.computeIfAbsent(messageStream, k -> new HashSet<>()).addAll(unexpectedFieldNames);
unexpectedFields.computeIfAbsent(messageStream, k -> ConcurrentHashMap.newKeySet()).addAll(unexpectedFieldNames);
}
}

Expand Down

0 comments on commit cf4f1a5

Please sign in to comment.