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

experimental spike for SO66453263 - zero padding #800

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mgravell
Copy link
Member

See https://stackoverflow.com/q/66453263/23354 for context

(existing data with zero-padding at the end)

@bmueller84
Copy link

As mentioned in my comment on stackoverflow, this solution works perfectly for my needs. Good job! So what are the next steps? Will that code be part of an official release?

@mgravell
Copy link
Member Author

Fundamentally, the problem here at least with the stream API is that it is very easy to consume data from a stream that you can't then put back; it would be become very tempting for users to think "oh, great, I can just use a zero sentinel between records", and then when they try: it works in their tests, and then they lose real data in production, because data was swallowed and dropped. We might be able to fix this partially for "pipelines", but: I think this is just too dangerous as written

@mgravell mgravell closed this Feb 23, 2022
@bmueller84
Copy link

I get your point. So, what alternative would you recommend for my zero-padded legacy data? It does work in older versions of protobuf, after all. Any help would be highly appreciated.

@mgravell mgravell reopened this Feb 27, 2022
@mgravell
Copy link
Member Author

Question: in your case it is just trailing padding data; not a separator - is that right? Maybe we can resurrect this but treble-doen on the warnings on the API, meaning "this will leave your stream in an undefined and unpredictable state after reading" - thoughts?

@bmueller84
Copy link

Yes, exactly; just zeros at the end (of the file, in this particular case). So, yes, this would be perfect for me.

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.

None yet

2 participants