claudevdm commented on code in PR #37474:
URL: https://github.com/apache/beam/pull/37474#discussion_r2766203577


##########
sdks/python/apache_beam/pipeline.py:
##########
@@ -226,8 +226,7 @@ def __init__(
       raise ValueError(
           'Pipeline has validations errors: \n' + '\n'.join(errors))
 
-    typecoders.registry.update_compatibility_version = self._options.view_as(
-        StreamingOptions).update_compatibility_version
+    pipeline_construction_options.options = self._options

Review Comment:
   >I think you meant 
pipeline_construction_options.PipelineConstructionOptions.options?
   pipeline_construction_options is a singleton instance, but I can see why 
this is confusing.
   
   > How ceratain are we that this won't cause some race condition? We could 
possibly key the singleton by a thread ID.
   There are other cases of singleton objects that are not thread safe, like 
coder registry used during pipeline construction. 
   Should we operate under the assumption that multiple pipelines can be 
constructed and run in parallel? We can make the singleton scoped to threads.
   
   
https://github.com/apache/beam/blob/99e48681a03276d829699fb5b5953241c6ed3172/sdks/python/apache_beam/coders/typecoders.py#L225



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to