question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Binary backwards-incompatibily in 1.33.0

See original GitHub issue

My library contains code like:

NettyChannelBuilder ncb = NettyChannelBuilder.forTarget(...);
ncb.setMaxInboundMessageSize(...);
ncb.eventLoopGroup(...);
// ...
ManagedChannel channel = ncb.build();

which breaks when moving from pre-1.33.0 to 1.33.0, unless recompiled (and then the new binary would not be compatible with versions < 1.33.0). This is because a class (AbstractManagedChannelImplBuilder) was removed from the direct superclass heriarchy:

Changing the direct superclass or the set of direct superinterfaces of a class type will not break compatibility with pre-existing binaries, provided that the total set of superclasses or superinterfaces, respectively, of the class type loses no members.

I know that technically netty transport is still considered experimental (per #1784), but (a) it’s the primary transport and (b) it’s been that way for more than 4 years.

Was this intentional/known or is it a case of “it’s experimental, tough!”?

It should be easy to avoid I think by for example just adding an empty abstract class AbstractManagedChannelImplBuilder extends ForwardingChannelBuilder… maybe in a 1.33.1? 😃

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:16 (16 by maintainers)

github_iconTop GitHub Comments

1reaction
ejona86commented, Oct 28, 2020

AbstractManagedChannelImplBuilder could still extend ForwardingChannelBuilder though, right? (just overriding the relevant methods)

Yes, it could. But that is of dubious value. New invocations of javac will still use the AbstractManagedChannelImplBuilder-returning methods.

and might you consider changing ForwardingChannelBuilder<T extends ForwardingChannelBuilder<T>> to ForwardingChannelBuilder<T extends ManagedChannelBuilder<T>> as part of this same 1.33.1 update (as you had previously suggested above)? Since it’s a brand new class so there should not be much risk of breakage (and given that 1.33.0 already has breakage)?

No. It isn’t a new class. It’s actually pretty old. We can do that with ForwardingServerBuilder, but it is probably better to just remove/hide the class in the short-term.

1reaction
ejona86commented, Oct 27, 2020

@njhill, in your example ForwardingChannelBuilder<T extends AbstractManagedChannelImplBuilder<T>> is redefining all the methods. So it is necessary. That signature is very bad though, as it increases the amount of code that will reference the internal class.

I was suggesting having ForwardingChannelBuilder<T extends ForwardingChannelBuilder<T>>, so that new compilations would stop referencing the internal class. For the old methods to show up with that approach, AbstractManagedChannelImplBuilder would need to redefine all the methods.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Creating Library with backward compatible ABI that uses Boost
Basically, just make sure the public interface to your library does not expose Boost. You can always use it however much you want...
Read more >
What introduce package/binary incompatibility?
Binary and package incompatibilities are different and are worth explaining ... are most careful about preserving backwards compatibility.
Read more >
Announcing Rust 1.33.0 : r/programming - Reddit
Code which is executed at compile-time, and their result stored in the binary.
Read more >
673839 – Review Request: boost141 - The free peer-reviewed ...
Yes, Boost had some interface changes and many of which are not backward ... form of this. there is no binary incompatibility between...
Read more >
BusyBox
Sizes of busybox-1.33.0 and busybox-1.34.0 (with equivalent config, ... in xmalloc_fgets" ash: allow shell scripts to be embedded in the binary ash: eval: ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found