Request Connection: Remote Server @ 192.229.145.200:80

本文详细介绍了在录制LoadRunner脚本时遇到的问题及其解决方案,包括配置IE浏览器、调整Network设置、确保脚本录制顺利进行。同时,阐述了压力测试中虚拟用户数量的决定因素、脚本录制中的事务、集合点、参数化等内容,以及如何设计测试场景和分析测试结果。此外,文章还讨论了脚本录制设置中不同CaptureLevel的影响,以及常见问题和解决策略。
录制Loadrunner脚本时,提示:
Request Connection: Remote Server @ 192.229.145.200:80   NOT INTERCEPTED!(REASON: User requested to IGNORE connection);
解决方法:
1. 打开IE里的Internet选项,单击连接选项卡。单击最下面的局域网设置,自动配置栏里的自动检测设置选项不要勾选。  
2.打开Virtual User Generator。在Record栏里面打开Recording Options,单击Network里面的PortMapping选项。查看Capture level。默认的应该是Socket level data ,将其变换成WinlNet level data(视情况而论)。
3.将IE浏览器设置为默认浏览器。打开Internet 选项,单击打开程序选项卡。里面有一个默认的web浏览器,单设置默认值。这样脚本就可以录制出来了。
 
压力机 VS 测试机 
能产生的虚拟用户数量由压力机的决定,
如果选择进程方式,每一个vuser都会启动一个mmdrv.exe,一个mmdrv大概占用内存30m左右
如果线程方式(需要保证客户端程序线程安全),默认情况下50个vuser启动一个mmdrv,内存占用跟进程方式类似。
尽量使用直联,不通过公网的交换机,不然测试的大都是本机的网络状态
 
脚本录制:
事务:Insert start/end transaction 
每一个操作都可以设置成一个事务,在测试时统计事务的响应时间,从而得知此操作的响应时间。
集合点:rendezvous
在脚本中加入集合点,可以让虚拟用户都集中到这个点后再进行下一操作,可以用于测试同一时间的并发数
参数化:parameter list 
模拟多用户,让测试场景更真实
内容检查:
在页面进行文字检查用以判断操作是否成功(会占用资源,尽量少使用)
 
场景设计: tools->create controller Scenario
 
结果分析:Tools->analysis
常见问题:
1. 事务响应时间先是缓慢的上升然后再平衡再下降 => 上升表示系统的处理能力在下降,平衡表示并发数量达到一定地步了,再多也接收不了,下降表示用户数量慢慢变少了。如果系统没有这样的机制(连接数量的限制)就会发生错误。
2. CPU的使用率不断的上升,内存的使用率也不断上升 => 表明系统里面可能产生了资源占用却没释放的情况
3. 所有都正常,发生了业务失败的情况 => 数据库可能被锁定了
4. 变化幅度比较大就说明不稳定
 
一些说明信息
在录制设置中:
当capture level为socket level data的时候
VuGen将捕获HTTP、SMTP、POP3、IMAP、OracleNCA和WinSocket协议
当capture level为wininet level data的时候
VuGen将捕获HTTP、FTP、Gopher协议
复制去Google翻译 翻译结果
 

转载于:https://www.cnblogs.com/bingpoli/p/4286058.html

[root@kafka1 hejia]# /usr/local/kafka_2.13-3.7.2/bin/kafka-server-start.sh /usr/local/kafka_2.13-3.7.2/config/server.properties [2025-09-01 17:10:47,478] INFO Registered kafka:type=kafka.Log4jController MBean (kafka.utils.Log4jControllerRegistration$) [2025-09-01 17:10:47,911] INFO Setting -D jdk.tls.rejectClientInitiatedRenegotiation=true to disable client-initiated TLS renegotiation (org.apache.zookeeper.common.X509Util) [2025-09-01 17:10:48,125] INFO Registered signal handlers for TERM, INT, HUP (org.apache.kafka.common.utils.LoggingSignalHandler) [2025-09-01 17:10:48,127] INFO starting (kafka.server.KafkaServer) [2025-09-01 17:10:48,128] INFO Connecting to zookeeper on 192.168.14.124:2181,192.168.14.125:2181,192.168.14.126:2181 (kafka.server.KafkaServer) [2025-09-01 17:10:48,145] INFO [ZooKeeperClient Kafka server] Initializing a new session to 192.168.14.124:2181,192.168.14.125:2181,192.168.14.126:2181. (kafka.zookeeper.ZooKeeperClient) [2025-09-01 17:10:48,151] INFO Client environment:zookeeper.version=3.8.4-9316c2a7a97e1666d8f4593f34dd6fc36ecc436c, built on 2024-02-12 22:16 UTC (org.apache.zookeeper.ZooKeeper) [2025-09-01 17:10:48,152] INFO Client environment:host.name=kafka1 (org.apache.zookeeper.ZooKeeper) [2025-09-01 17:10:48,152] INFO Client environment:java.version=1.8.0_171 (org.apache.zookeeper.ZooKeeper) [2025-09-01 17:10:48,152] INFO Client environment:java.vendor=Oracle Corporation (org.apache.zookeeper.ZooKeeper) [2025-09-01 17:10:48,152] INFO Client environment:java.home=/usr/local/jdk1.8.0_171/jre (org.apache.zookeeper.ZooKeeper) [2025-09-01 17:10:48,152] INFO Client environment:java.class.path=/usr/local/jdk1.8.0_171/jre/lib/ext:/usr/local/jdk1.8.0_171/lib/tools.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/activation-1.1.1.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/aopalliance-repackaged-2.6.1.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/argparse4j-0.7.0.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/audience-annotations-0.12.0.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/caffeine-2.9.3.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/checker-qual-3.19.0.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/commons-beanutils-1.9.4.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/commons-cli-1.4.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/commons-collections-3.2.2.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/commons-digester-2.1.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/commons-io-2.14.0.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/commons-lang3-3.8.1.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/commons-logging-1.2.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/commons-validator-1.7.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/connect-api-3.7.2.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/connect-basic-auth-extension-3.7.2.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/connect-json-3.7.2.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/connect-mirror-3.7.2.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/connect-mirror-client-3.7.2.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/connect-runtime-3.7.2.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/connect-transforms-3.7.2.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/error_prone_annotations-2.10.0.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/hk2-api-2.6.1.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/hk2-locator-2.6.1.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/hk2-utils-2.6.1.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/jackson-annotations-2.16.2.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/jackson-core-2.16.2.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/jackson-databind-2.16.2.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/jackson-dataformat-csv-2.16.2.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/jackson-datatype-jdk8-2.16.2.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/jackson-jaxrs-base-2.16.2.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/jackson-jaxrs-json-provider-2.16.2.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/jackson-module-jaxb-annotations-2.16.2.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/jackson-module-scala_2.13-2.16.2.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/jakarta.activation-api-1.2.2.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/jakarta.annotation-api-1.3.5.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/jakarta.inject-2.6.1.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/jakarta.validation-api-2.0.2.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/jakarta.ws.rs-api-2.1.6.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/jakarta.xml.bind-api-2.3.3.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/javassist-3.29.2-GA.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/javax.activation-api-1.2.0.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/javax.annotation-api-1.3.2.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/javax.servlet-api-3.1.0.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/javax.ws.rs-api-2.1.1.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/jaxb-api-2.3.1.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/jersey-client-2.39.1.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/jersey-common-2.39.1.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/jersey-container-servlet-2.39.1.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/jersey-container-servlet-core-2.39.1.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/jersey-hk2-2.39.1.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/jersey-server-2.39.1.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/jetty-client-9.4.56.v20240826.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/jetty-continuation-9.4.56.v20240826.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/jetty-http-9.4.56.v20240826.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/jetty-io-9.4.56.v20240826.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/jetty-security-9.4.56.v20240826.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/jetty-server-9.4.56.v20240826.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/jetty-servlet-9.4.56.v20240826.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/jetty-servlets-9.4.56.v20240826.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/jetty-util-9.4.56.v20240826.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/jetty-util-ajax-9.4.56.v20240826.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/jline-3.25.1.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/jopt-simple-5.0.4.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/jose4j-0.9.4.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/jsr305-3.0.2.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/kafka_2.13-3.7.2.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/kafka-clients-3.7.2.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/kafka-group-coordinator-3.7.2.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/kafka-log4j-appender-3.7.2.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/kafka-metadata-3.7.2.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/kafka-raft-3.7.2.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/kafka-server-3.7.2.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/kafka-server-common-3.7.2.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/kafka-shell-3.7.2.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/kafka-storage-3.7.2.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/kafka-storage-api-3.7.2.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/kafka-streams-3.7.2.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/kafka-streams-examples-3.7.2.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/kafka-streams-scala_2.13-3.7.2.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/kafka-streams-test-utils-3.7.2.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/kafka-tools-3.7.2.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/kafka-tools-api-3.7.2.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/lz4-java-1.8.0.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/maven-artifact-3.8.8.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/metrics-core-2.2.0.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/metrics-core-4.1.12.1.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/netty-buffer-4.1.115.Final.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/netty-codec-4.1.115.Final.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/netty-common-4.1.115.Final.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/netty-handler-4.1.115.Final.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/netty-resolver-4.1.115.Final.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/netty-transport-4.1.115.Final.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/netty-transport-classes-epoll-4.1.115.Final.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/netty-transport-native-epoll-4.1.115.Final.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/netty-transport-native-unix-common-4.1.115.Final.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/opentelemetry-proto-1.0.0-alpha.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/osgi-resource-locator-1.0.3.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/paranamer-2.8.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/pcollections-4.0.1.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/plexus-utils-3.3.1.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/protobuf-java-3.25.5.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/reflections-0.10.2.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/reload4j-1.2.25.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/rocksdbjni-7.9.2.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/scala-collection-compat_2.13-2.10.0.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/scala-java8-compat_2.13-1.0.2.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/scala-library-2.13.12.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/scala-logging_2.13-3.9.4.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/scala-reflect-2.13.12.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/slf4j-api-1.7.36.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/slf4j-reload4j-1.7.36.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/snappy-java-1.1.10.5.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/swagger-annotations-2.2.8.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/trogdor-3.7.2.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/zookeeper-3.8.4.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/zookeeper-jute-3.8.4.jar:/usr/local/kafka_2.13-3.7.2/bin/../libs/zstd-jni-1.5.6-4.jar (org.apache.zookeeper.ZooKeeper) [2025-09-01 17:10:48,153] INFO Client environment:java.library.path=/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib (org.apache.zookeeper.ZooKeeper) [2025-09-01 17:10:48,153] INFO Client environment:java.io.tmpdir=/tmp (org.apache.zookeeper.ZooKeeper) [2025-09-01 17:10:48,153] INFO Client environment:java.compiler=<NA> (org.apache.zookeeper.ZooKeeper) [2025-09-01 17:10:48,154] INFO Client environment:os.name=Linux (org.apache.zookeeper.ZooKeeper) [2025-09-01 17:10:48,154] INFO Client environment:os.arch=amd64 (org.apache.zookeeper.ZooKeeper) [2025-09-01 17:10:48,154] INFO Client environment:os.version=3.10.0-1160.el7.x86_64 (org.apache.zookeeper.ZooKeeper) [2025-09-01 17:10:48,154] INFO Client environment:user.name=root (org.apache.zookeeper.ZooKeeper) [2025-09-01 17:10:48,154] INFO Client environment:user.home=/root (org.apache.zookeeper.ZooKeeper) [2025-09-01 17:10:48,154] INFO Client environment:user.dir=/home/hejia (org.apache.zookeeper.ZooKeeper) [2025-09-01 17:10:48,154] INFO Client environment:os.memory.free=1003MB (org.apache.zookeeper.ZooKeeper) [2025-09-01 17:10:48,154] INFO Client environment:os.memory.max=1024MB (org.apache.zookeeper.ZooKeeper) [2025-09-01 17:10:48,154] INFO Client environment:os.memory.total=1024MB (org.apache.zookeeper.ZooKeeper) [2025-09-01 17:10:48,157] INFO Initiating client connection, connectString=192.168.14.124:2181,192.168.14.125:2181,192.168.14.126:2181 sessionTimeout=18000 watcher=kafka.zookeeper.ZooKeeperClient$ZooKeeperClientWatcher$@6150c3ec (org.apache.zookeeper.ZooKeeper) [2025-09-01 17:10:48,161] INFO jute.maxbuffer value is 4194304 Bytes (org.apache.zookeeper.ClientCnxnSocket) [2025-09-01 17:10:48,170] INFO zookeeper.request.timeout value is 0. feature enabled=false (org.apache.zookeeper.ClientCnxn) [2025-09-01 17:10:48,172] INFO [ZooKeeperClient Kafka server] Waiting until connected. (kafka.zookeeper.ZooKeeperClient) [2025-09-01 17:10:48,174] INFO Opening socket connection to server /192.168.14.126:2181. (org.apache.zookeeper.ClientCnxn) [2025-09-01 17:10:48,178] INFO Socket connection established, initiating session, client: /192.168.14.124:42150, server: /192.168.14.126:2181 (org.apache.zookeeper.ClientCnxn) [2025-09-01 17:10:48,184] INFO Session establishment complete on server /192.168.14.126:2181, session id = 0x3000359362800e9, negotiated timeout = 18000 (org.apache.zookeeper.ClientCnxn) [2025-09-01 17:10:48,187] INFO [ZooKeeperClient Kafka server] Connected. (kafka.zookeeper.ZooKeeperClient) [2025-09-01 17:10:48,627] INFO Cluster ID = eQFewTrDRa6Csx8shnSzQQ (kafka.server.KafkaServer) [2025-09-01 17:10:48,709] INFO KafkaConfig values: advertised.listeners = null alter.config.policy.class.name = null alter.log.dirs.replication.quota.window.num = 11 alter.log.dirs.replication.quota.window.size.seconds = 1 authorizer.class.name = auto.create.topics.enable = true auto.include.jmx.reporter = true auto.leader.rebalance.enable = true background.threads = 10 broker.heartbeat.interval.ms = 2000 broker.id = 0 broker.id.generation.enable = true broker.rack = null broker.session.timeout.ms = 9000 client.quota.callback.class = null compression.type = producer connection.failed.authentication.delay.ms = 100 connections.max.idle.ms = 600000 connections.max.reauth.ms = 0 control.plane.listener.name = null controlled.shutdown.enable = true controlled.shutdown.max.retries = 3 controlled.shutdown.retry.backoff.ms = 5000 controller.listener.names = null controller.quorum.append.linger.ms = 25 controller.quorum.election.backoff.max.ms = 1000 controller.quorum.election.timeout.ms = 1000 controller.quorum.fetch.timeout.ms = 2000 controller.quorum.request.timeout.ms = 2000 controller.quorum.retry.backoff.ms = 20 controller.quorum.voters = [] controller.quota.window.num = 11 controller.quota.window.size.seconds = 1 controller.socket.timeout.ms = 30000 create.topic.policy.class.name = null default.replication.factor = 1 delegation.token.expiry.check.interval.ms = 3600000 delegation.token.expiry.time.ms = 86400000 delegation.token.master.key = null delegation.token.max.lifetime.ms = 604800000 delegation.token.secret.key = null delete.records.purgatory.purge.interval.requests = 1 delete.topic.enable = true early.start.listeners = null eligible.leader.replicas.enable = false fetch.max.bytes = 57671680 fetch.purgatory.purge.interval.requests = 1000 group.consumer.assignors = [org.apache.kafka.coordinator.group.assignor.UniformAssignor, org.apache.kafka.coordinator.group.assignor.RangeAssignor] group.consumer.heartbeat.interval.ms = 5000 group.consumer.max.heartbeat.interval.ms = 15000 group.consumer.max.session.timeout.ms = 60000 group.consumer.max.size = 2147483647 group.consumer.min.heartbeat.interval.ms = 5000 group.consumer.min.session.timeout.ms = 45000 group.consumer.session.timeout.ms = 45000 group.coordinator.new.enable = false group.coordinator.rebalance.protocols = [classic] group.coordinator.threads = 1 group.initial.rebalance.delay.ms = 0 group.max.session.timeout.ms = 1800000 group.max.size = 2147483647 group.min.session.timeout.ms = 6000 initial.broker.registration.timeout.ms = 60000 inter.broker.listener.name = null inter.broker.protocol.version = 3.7-IV4 kafka.metrics.polling.interval.secs = 10 kafka.metrics.reporters = [] leader.imbalance.check.interval.seconds = 300 leader.imbalance.per.broker.percentage = 10 listener.security.protocol.map = PLAINTEXT:PLAINTEXT,SSL:SSL,SASL_PLAINTEXT:SASL_PLAINTEXT,SASL_SSL:SASL_SSL listeners = PLAINTEXT://192.168.14.124:9092 log.cleaner.backoff.ms = 15000 log.cleaner.dedupe.buffer.size = 134217728 log.cleaner.delete.retention.ms = 86400000 log.cleaner.enable = true log.cleaner.io.buffer.load.factor = 0.9 log.cleaner.io.buffer.size = 524288 log.cleaner.io.max.bytes.per.second = 1.7976931348623157E308 log.cleaner.max.compaction.lag.ms = 9223372036854775807 log.cleaner.min.cleanable.ratio = 0.5 log.cleaner.min.compaction.lag.ms = 0 log.cleaner.threads = 1 log.cleanup.policy = [delete] log.dir = /tmp/kafka-logs log.dirs = /data/kafka/log log.flush.interval.messages = 9223372036854775807 log.flush.interval.ms = null log.flush.offset.checkpoint.interval.ms = 60000 log.flush.scheduler.interval.ms = 9223372036854775807 log.flush.start.offset.checkpoint.interval.ms = 60000 log.index.interval.bytes = 4096 log.index.size.max.bytes = 10485760 log.local.retention.bytes = -2 log.local.retention.ms = -2 log.message.downconversion.enable = true log.message.format.version = 3.0-IV1 log.message.timestamp.after.max.ms = 9223372036854775807 log.message.timestamp.before.max.ms = 9223372036854775807 log.message.timestamp.difference.max.ms = 9223372036854775807 log.message.timestamp.type = CreateTime log.preallocate = false log.retention.bytes = -1 log.retention.check.interval.ms = 300000 log.retention.hours = 168 log.retention.minutes = null log.retention.ms = null log.roll.hours = 168 log.roll.jitter.hours = 0 log.roll.jitter.ms = null log.roll.ms = null log.segment.bytes = 1073741824 log.segment.delete.delay.ms = 60000 max.connection.creation.rate = 2147483647 max.connections = 2147483647 max.connections.per.ip = 2147483647 max.connections.per.ip.overrides = max.incremental.fetch.session.cache.slots = 1000 message.max.bytes = 1048588 metadata.log.dir = null metadata.log.max.record.bytes.between.snapshots = 20971520 metadata.log.max.snapshot.interval.ms = 3600000 metadata.log.segment.bytes = 1073741824 metadata.log.segment.min.bytes = 8388608 metadata.log.segment.ms = 604800000 metadata.max.idle.interval.ms = 500 metadata.max.retention.bytes = 104857600 metadata.max.retention.ms = 604800000 metric.reporters = [] metrics.num.samples = 2 metrics.recording.level = INFO metrics.sample.window.ms = 30000 min.insync.replicas = 1 node.id = 0 num.io.threads = 8 num.network.threads = 3 num.partitions = 1 num.recovery.threads.per.data.dir = 1 num.replica.alter.log.dirs.threads = null num.replica.fetchers = 1 offset.metadata.max.bytes = 4096 offsets.commit.required.acks = -1 offsets.commit.timeout.ms = 5000 offsets.load.buffer.size = 5242880 offsets.retention.check.interval.ms = 600000 offsets.retention.minutes = 10080 offsets.topic.compression.codec = 0 offsets.topic.num.partitions = 50 offsets.topic.replication.factor = 1 offsets.topic.segment.bytes = 104857600 password.encoder.cipher.algorithm = AES/CBC/PKCS5Padding password.encoder.iterations = 4096 password.encoder.key.length = 128 password.encoder.keyfactory.algorithm = null password.encoder.old.secret = null password.encoder.secret = null principal.builder.class = class org.apache.kafka.common.security.authenticator.DefaultKafkaPrincipalBuilder process.roles = [] producer.id.expiration.check.interval.ms = 600000 producer.id.expiration.ms = 86400000 producer.purgatory.purge.interval.requests = 1000 queued.max.request.bytes = -1 queued.max.requests = 500 quota.window.num = 11 quota.window.size.seconds = 1 remote.log.index.file.cache.total.size.bytes = 1073741824 remote.log.manager.task.interval.ms = 30000 remote.log.manager.task.retry.backoff.max.ms = 30000 remote.log.manager.task.retry.backoff.ms = 500 remote.log.manager.task.retry.jitter = 0.2 remote.log.manager.thread.pool.size = 10 remote.log.metadata.custom.metadata.max.bytes = 128 remote.log.metadata.manager.class.name = org.apache.kafka.server.log.remote.metadata.storage.TopicBasedRemoteLogMetadataManager remote.log.metadata.manager.class.path = null remote.log.metadata.manager.impl.prefix = rlmm.config. remote.log.metadata.manager.listener.name = null remote.log.reader.max.pending.tasks = 100 remote.log.reader.threads = 10 remote.log.storage.manager.class.name = null remote.log.storage.manager.class.path = null remote.log.storage.manager.impl.prefix = rsm.config. remote.log.storage.system.enable = false replica.fetch.backoff.ms = 1000 replica.fetch.max.bytes = 1048576 replica.fetch.min.bytes = 1 replica.fetch.response.max.bytes = 10485760 replica.fetch.wait.max.ms = 500 replica.high.watermark.checkpoint.interval.ms = 5000 replica.lag.time.max.ms = 30000 replica.selector.class = null replica.socket.receive.buffer.bytes = 65536 replica.socket.timeout.ms = 30000 replication.quota.window.num = 11 replication.quota.window.size.seconds = 1 request.timeout.ms = 30000 reserved.broker.max.id = 1000 sasl.client.callback.handler.class = null sasl.enabled.mechanisms = [GSSAPI] sasl.jaas.config = null sasl.kerberos.kinit.cmd = /usr/bin/kinit sasl.kerberos.min.time.before.relogin = 60000 sasl.kerberos.principal.to.local.rules = [DEFAULT] sasl.kerberos.service.name = null sasl.kerberos.ticket.renew.jitter = 0.05 sasl.kerberos.ticket.renew.window.factor = 0.8 sasl.login.callback.handler.class = null sasl.login.class = null sasl.login.connect.timeout.ms = null sasl.login.read.timeout.ms = null sasl.login.refresh.buffer.seconds = 300 sasl.login.refresh.min.period.seconds = 60 sasl.login.refresh.window.factor = 0.8 sasl.login.refresh.window.jitter = 0.05 sasl.login.retry.backoff.max.ms = 10000 sasl.login.retry.backoff.ms = 100 sasl.mechanism.controller.protocol = GSSAPI sasl.mechanism.inter.broker.protocol = GSSAPI sasl.oauthbearer.clock.skew.seconds = 30 sasl.oauthbearer.expected.audience = null sasl.oauthbearer.expected.issuer = null sasl.oauthbearer.jwks.endpoint.refresh.ms = 3600000 sasl.oauthbearer.jwks.endpoint.retry.backoff.max.ms = 10000 sasl.oauthbearer.jwks.endpoint.retry.backoff.ms = 100 sasl.oauthbearer.jwks.endpoint.url = null sasl.oauthbearer.scope.claim.name = scope sasl.oauthbearer.sub.claim.name = sub sasl.oauthbearer.token.endpoint.url = null sasl.server.callback.handler.class = null sasl.server.max.receive.size = 524288 security.inter.broker.protocol = PLAINTEXT security.providers = null server.max.startup.time.ms = 9223372036854775807 socket.connection.setup.timeout.max.ms = 30000 socket.connection.setup.timeout.ms = 10000 socket.listen.backlog.size = 50 socket.receive.buffer.bytes = 102400 socket.request.max.bytes = 104857600 socket.send.buffer.bytes = 102400 ssl.allow.dn.changes = false ssl.allow.san.changes = false ssl.cipher.suites = [] ssl.client.auth = none ssl.enabled.protocols = [TLSv1.2] ssl.endpoint.identification.algorithm = https ssl.engine.factory.class = null ssl.key.password = null ssl.keymanager.algorithm = SunX509 ssl.keystore.certificate.chain = null ssl.keystore.key = null ssl.keystore.location = null ssl.keystore.password = null ssl.keystore.type = JKS ssl.principal.mapping.rules = DEFAULT ssl.protocol = TLSv1.2 ssl.provider = null ssl.secure.random.implementation = null ssl.trustmanager.algorithm = PKIX ssl.truststore.certificates = null ssl.truststore.location = null ssl.truststore.password = null ssl.truststore.type = JKS telemetry.max.bytes = 1048576 transaction.abort.timed.out.transaction.cleanup.interval.ms = 10000 transaction.max.timeout.ms = 900000 transaction.partition.verification.enable = true transaction.remove.expired.transaction.cleanup.interval.ms = 3600000 transaction.state.log.load.buffer.size = 5242880 transaction.state.log.min.isr = 1 transaction.state.log.num.partitions = 50 transaction.state.log.replication.factor = 1 transaction.state.log.segment.bytes = 104857600 transactional.id.expiration.ms = 604800000 unclean.leader.election.enable = false unstable.api.versions.enable = false unstable.metadata.versions.enable = false zookeeper.clientCnxnSocket = null zookeeper.connect = 192.168.14.124:2181,192.168.14.125:2181,192.168.14.126:2181 zookeeper.connection.timeout.ms = 18000 zookeeper.max.in.flight.requests = 10 zookeeper.metadata.migration.enable = false zookeeper.metadata.migration.min.batch.size = 200 zookeeper.session.timeout.ms = 18000 zookeeper.set.acl = false zookeeper.ssl.cipher.suites = null zookeeper.ssl.client.enable = false zookeeper.ssl.crl.enable = false zookeeper.ssl.enabled.protocols = null zookeeper.ssl.endpoint.identification.algorithm = HTTPS zookeeper.ssl.keystore.location = null zookeeper.ssl.keystore.password = null zookeeper.ssl.keystore.type = null zookeeper.ssl.ocsp.enable = false zookeeper.ssl.protocol = TLSv1.2 zookeeper.ssl.truststore.location = null zookeeper.ssl.truststore.password = null zookeeper.ssl.truststore.type = null (kafka.server.KafkaConfig) [2025-09-01 17:10:48,784] INFO [ThrottledChannelReaper-Fetch]: Starting (kafka.server.ClientQuotaManager$ThrottledChannelReaper) [2025-09-01 17:10:48,785] INFO [ThrottledChannelReaper-Produce]: Starting (kafka.server.ClientQuotaManager$ThrottledChannelReaper) [2025-09-01 17:10:48,789] INFO [ThrottledChannelReaper-Request]: Starting (kafka.server.ClientQuotaManager$ThrottledChannelReaper) [2025-09-01 17:10:48,791] INFO [ThrottledChannelReaper-ControllerMutation]: Starting (kafka.server.ClientQuotaManager$ThrottledChannelReaper) [2025-09-01 17:10:48,953] INFO Loading logs from log dirs ArraySeq(/data/kafka/log) (kafka.log.LogManager) [2025-09-01 17:10:48,960] INFO No logs found to be loaded in /data/kafka/log (kafka.log.LogManager) [2025-09-01 17:10:48,982] INFO Loaded 0 logs in 28ms (kafka.log.LogManager) [2025-09-01 17:10:48,985] INFO Starting log cleanup with a period of 300000 ms. (kafka.log.LogManager) [2025-09-01 17:10:48,987] INFO Starting log flusher with a default period of 9223372036854775807 ms. (kafka.log.LogManager) [2025-09-01 17:10:49,700] INFO [kafka-log-cleaner-thread-0]: Starting (kafka.log.LogCleaner$CleanerThread) [2025-09-01 17:10:49,723] INFO [feature-zk-node-event-process-thread]: Starting (kafka.server.FinalizedFeatureChangeListener$ChangeNotificationProcessorThread) [2025-09-01 17:10:49,754] INFO [MetadataCache brokerId=0] Updated cache from existing None to latest Features(version=3.7-IV4, finalizedFeatures={}, finalizedFeaturesEpoch=0). (kafka.server.metadata.ZkMetadataCache) [2025-09-01 17:10:49,807] INFO [zk-broker-0-to-controller-forwarding-channel-manager]: Starting (kafka.server.NodeToControllerRequestThread) [2025-09-01 17:10:50,663] INFO Updated connection-accept-rate max connection creation rate to 2147483647 (kafka.network.ConnectionQuotas) [2025-09-01 17:10:50,694] INFO [SocketServer listenerType=ZK_BROKER, nodeId=0] Created data-plane acceptor and processors for endpoint : ListenerName(PLAINTEXT) (kafka.network.SocketServer) [2025-09-01 17:10:50,719] INFO [zk-broker-0-to-controller-alter-partition-channel-manager]: Starting (kafka.server.NodeToControllerRequestThread) [2025-09-01 17:10:50,797] INFO [ExpirationReaper-0-Produce]: Starting (kafka.server.DelayedOperationPurgatory$ExpiredOperationReaper) [2025-09-01 17:10:50,928] INFO [ExpirationReaper-0-Fetch]: Starting (kafka.server.DelayedOperationPurgatory$ExpiredOperationReaper) [2025-09-01 17:10:50,929] INFO [ExpirationReaper-0-DeleteRecords]: Starting (kafka.server.DelayedOperationPurgatory$ExpiredOperationReaper) [2025-09-01 17:10:50,931] INFO [ExpirationReaper-0-ElectLeader]: Starting (kafka.server.DelayedOperationPurgatory$ExpiredOperationReaper) [2025-09-01 17:10:50,939] INFO [ExpirationReaper-0-RemoteFetch]: Starting (kafka.server.DelayedOperationPurgatory$ExpiredOperationReaper) [2025-09-01 17:10:50,963] INFO [LogDirFailureHandler]: Starting (kafka.server.ReplicaManager$LogDirFailureHandler) [2025-09-01 17:10:50,970] INFO [AddPartitionsToTxnSenderThread-0]: Starting (kafka.server.AddPartitionsToTxnManager) [2025-09-01 17:10:51,183] INFO Creating /brokers/ids/0 (is it secure? false) (kafka.zk.KafkaZkClient) [2025-09-01 17:10:51,209] ERROR Error while creating ephemeral at /brokers/ids/0, node already exists and owner '0x200038df42600ef' does not match current session '0x3000359362800e9' (kafka.zk.KafkaZkClient$CheckedEphemeral) [2025-09-01 17:10:51,235] ERROR [KafkaServer id=0] Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer) org.apache.zookeeper.KeeperException$NodeExistsException: KeeperErrorCode = NodeExists at org.apache.zookeeper.KeeperException.create(KeeperException.java:126) at kafka.zk.KafkaZkClient$CheckedEphemeral.getAfterNodeExists(KafkaZkClient.scala:2238) at kafka.zk.KafkaZkClient$CheckedEphemeral.create(KafkaZkClient.scala:2176) at kafka.zk.KafkaZkClient.checkedEphemeralCreate(KafkaZkClient.scala:2143) at kafka.zk.KafkaZkClient.registerBroker(KafkaZkClient.scala:110) at kafka.server.KafkaServer.startup(KafkaServer.scala:404) at kafka.Kafka$.main(Kafka.scala:112) at kafka.Kafka.main(Kafka.scala) [2025-09-01 17:10:51,238] INFO [KafkaServer id=0] shutting down (kafka.server.KafkaServer) [2025-09-01 17:10:51,239] INFO [SocketServer listenerType=ZK_BROKER, nodeId=0] Stopping socket server request processors (kafka.network.SocketServer) [2025-09-01 17:10:51,245] INFO [SocketServer listenerType=ZK_BROKER, nodeId=0] Stopped socket server request processors (kafka.network.SocketServer) [2025-09-01 17:10:51,248] INFO [ReplicaManager broker=0] Shutting down (kafka.server.ReplicaManager) [2025-09-01 17:10:51,250] INFO [LogDirFailureHandler]: Shutting down (kafka.server.ReplicaManager$LogDirFailureHandler) [2025-09-01 17:10:51,250] INFO [LogDirFailureHandler]: Stopped (kafka.server.ReplicaManager$LogDirFailureHandler) [2025-09-01 17:10:51,250] INFO [LogDirFailureHandler]: Shutdown completed (kafka.server.ReplicaManager$LogDirFailureHandler) [2025-09-01 17:10:51,251] INFO [ReplicaFetcherManager on broker 0] shutting down (kafka.server.ReplicaFetcherManager) [2025-09-01 17:10:51,252] INFO [ReplicaFetcherManager on broker 0] shutdown completed (kafka.server.ReplicaFetcherManager) [2025-09-01 17:10:51,252] INFO [ReplicaAlterLogDirsManager on broker 0] shutting down (kafka.server.ReplicaAlterLogDirsManager) [2025-09-01 17:10:51,252] INFO [ReplicaAlterLogDirsManager on broker 0] shutdown completed (kafka.server.ReplicaAlterLogDirsManager) [2025-09-01 17:10:51,253] INFO [ExpirationReaper-0-Fetch]: Shutting down (kafka.server.DelayedOperationPurgatory$ExpiredOperationReaper) [2025-09-01 17:10:51,253] INFO [ExpirationReaper-0-Fetch]: Stopped (kafka.server.DelayedOperationPurgatory$ExpiredOperationReaper) [2025-09-01 17:10:51,254] INFO [ExpirationReaper-0-Fetch]: Shutdown completed (kafka.server.DelayedOperationPurgatory$ExpiredOperationReaper) [2025-09-01 17:10:51,254] INFO [ExpirationReaper-0-RemoteFetch]: Shutting down (kafka.server.DelayedOperationPurgatory$ExpiredOperationReaper) [2025-09-01 17:10:51,255] INFO [ExpirationReaper-0-RemoteFetch]: Stopped (kafka.server.DelayedOperationPurgatory$ExpiredOperationReaper) [2025-09-01 17:10:51,255] INFO [ExpirationReaper-0-RemoteFetch]: Shutdown completed (kafka.server.DelayedOperationPurgatory$ExpiredOperationReaper) [2025-09-01 17:10:51,255] INFO [ExpirationReaper-0-Produce]: Shutting down (kafka.server.DelayedOperationPurgatory$ExpiredOperationReaper) [2025-09-01 17:10:51,255] INFO [ExpirationReaper-0-Produce]: Stopped (kafka.server.DelayedOperationPurgatory$ExpiredOperationReaper) [2025-09-01 17:10:51,256] INFO [ExpirationReaper-0-Produce]: Shutdown completed (kafka.server.DelayedOperationPurgatory$ExpiredOperationReaper) [2025-09-01 17:10:51,256] INFO [ExpirationReaper-0-DeleteRecords]: Shutting down (kafka.server.DelayedOperationPurgatory$ExpiredOperationReaper) [2025-09-01 17:10:51,256] INFO [ExpirationReaper-0-DeleteRecords]: Stopped (kafka.server.DelayedOperationPurgatory$ExpiredOperationReaper) [2025-09-01 17:10:51,256] INFO [ExpirationReaper-0-DeleteRecords]: Shutdown completed (kafka.server.DelayedOperationPurgatory$ExpiredOperationReaper) [2025-09-01 17:10:51,257] INFO [ExpirationReaper-0-ElectLeader]: Shutting down (kafka.server.DelayedOperationPurgatory$ExpiredOperationReaper) [2025-09-01 17:10:51,257] INFO [ExpirationReaper-0-ElectLeader]: Stopped (kafka.server.DelayedOperationPurgatory$ExpiredOperationReaper) [2025-09-01 17:10:51,257] INFO [ExpirationReaper-0-ElectLeader]: Shutdown completed (kafka.server.DelayedOperationPurgatory$ExpiredOperationReaper) [2025-09-01 17:10:51,264] INFO [AddPartitionsToTxnSenderThread-0]: Shutting down (kafka.server.AddPartitionsToTxnManager) [2025-09-01 17:10:51,265] INFO [AddPartitionsToTxnSenderThread-0]: Stopped (kafka.server.AddPartitionsToTxnManager) [2025-09-01 17:10:51,265] INFO [AddPartitionsToTxnSenderThread-0]: Shutdown completed (kafka.server.AddPartitionsToTxnManager) [2025-09-01 17:10:51,267] INFO [ReplicaManager broker=0] Shut down completely (kafka.server.ReplicaManager) [2025-09-01 17:10:51,267] INFO [zk-broker-0-to-controller-alter-partition-channel-manager]: Shutting down (kafka.server.NodeToControllerRequestThread) [2025-09-01 17:10:51,268] INFO [zk-broker-0-to-controller-alter-partition-channel-manager]: Stopped (kafka.server.NodeToControllerRequestThread) [2025-09-01 17:10:51,268] INFO [zk-broker-0-to-controller-alter-partition-channel-manager]: Shutdown completed (kafka.server.NodeToControllerRequestThread) [2025-09-01 17:10:51,269] INFO Node to controller channel manager for alter-partition shutdown (kafka.server.NodeToControllerChannelManagerImpl) [2025-09-01 17:10:51,269] INFO [zk-broker-0-to-controller-forwarding-channel-manager]: Shutting down (kafka.server.NodeToControllerRequestThread) [2025-09-01 17:10:51,270] INFO [zk-broker-0-to-controller-forwarding-channel-manager]: Stopped (kafka.server.NodeToControllerRequestThread) [2025-09-01 17:10:51,270] INFO [zk-broker-0-to-controller-forwarding-channel-manager]: Shutdown completed (kafka.server.NodeToControllerRequestThread) [2025-09-01 17:10:51,270] INFO Node to controller channel manager for forwarding shutdown (kafka.server.NodeToControllerChannelManagerImpl) [2025-09-01 17:10:51,271] INFO Shutting down. (kafka.log.LogManager) [2025-09-01 17:10:51,273] INFO [kafka-log-cleaner-thread-0]: Shutting down (kafka.log.LogCleaner$CleanerThread) [2025-09-01 17:10:51,275] INFO [kafka-log-cleaner-thread-0]: Stopped (kafka.log.LogCleaner$CleanerThread) [2025-09-01 17:10:51,275] INFO [kafka-log-cleaner-thread-0]: Shutdown completed (kafka.log.LogCleaner$CleanerThread) [2025-09-01 17:10:51,336] INFO Shutdown complete. (kafka.log.LogManager) [2025-09-01 17:10:51,490] INFO [feature-zk-node-event-process-thread]: Shutting down (kafka.server.FinalizedFeatureChangeListener$ChangeNotificationProcessorThread) [2025-09-01 17:10:51,490] INFO [feature-zk-node-event-process-thread]: Stopped (kafka.server.FinalizedFeatureChangeListener$ChangeNotificationProcessorThread) [2025-09-01 17:10:51,490] INFO [feature-zk-node-event-process-thread]: Shutdown completed (kafka.server.FinalizedFeatureChangeListener$ChangeNotificationProcessorThread) [2025-09-01 17:10:51,491] INFO [ZooKeeperClient Kafka server] Closing. (kafka.zookeeper.ZooKeeperClient) [2025-09-01 17:10:51,623] INFO Session: 0x3000359362800e9 closed (org.apache.zookeeper.ZooKeeper) [2025-09-01 17:10:51,624] INFO EventThread shut down for session: 0x3000359362800e9 (org.apache.zookeeper.ClientCnxn) [2025-09-01 17:10:51,745] INFO [ZooKeeperClient Kafka server] Closed. (kafka.zookeeper.ZooKeeperClient) [2025-09-01 17:10:51,748] INFO [ThrottledChannelReaper-Fetch]: Shutting down (kafka.server.ClientQuotaManager$ThrottledChannelReaper) [2025-09-01 17:10:51,758] INFO [ThrottledChannelReaper-Fetch]: Stopped (kafka.server.ClientQuotaManager$ThrottledChannelReaper) [2025-09-01 17:10:51,778] INFO [ThrottledChannelReaper-Fetch]: Shutdown completed (kafka.server.ClientQuotaManager$ThrottledChannelReaper) [2025-09-01 17:10:51,778] INFO [ThrottledChannelReaper-Produce]: Shutting down (kafka.server.ClientQuotaManager$ThrottledChannelReaper) [2025-09-01 17:10:51,792] INFO [ThrottledChannelReaper-Produce]: Stopped (kafka.server.ClientQuotaManager$ThrottledChannelReaper) [2025-09-01 17:10:51,792] INFO [ThrottledChannelReaper-Produce]: Shutdown completed (kafka.server.ClientQuotaManager$ThrottledChannelReaper) [2025-09-01 17:10:51,792] INFO [ThrottledChannelReaper-Request]: Shutting down (kafka.server.ClientQuotaManager$ThrottledChannelReaper) [2025-09-01 17:10:51,792] INFO [ThrottledChannelReaper-Request]: Stopped (kafka.server.ClientQuotaManager$ThrottledChannelReaper) [2025-09-01 17:10:51,792] INFO [ThrottledChannelReaper-Request]: Shutdown completed (kafka.server.ClientQuotaManager$ThrottledChannelReaper) [2025-09-01 17:10:51,806] INFO [ThrottledChannelReaper-ControllerMutation]: Shutting down (kafka.server.ClientQuotaManager$ThrottledChannelReaper) [2025-09-01 17:10:51,806] INFO [ThrottledChannelReaper-ControllerMutation]: Stopped (kafka.server.ClientQuotaManager$ThrottledChannelReaper) [2025-09-01 17:10:51,806] INFO [ThrottledChannelReaper-ControllerMutation]: Shutdown completed (kafka.server.ClientQuotaManager$ThrottledChannelReaper) [2025-09-01 17:10:51,830] INFO [SocketServer listenerType=ZK_BROKER, nodeId=0] Shutting down socket server (kafka.network.SocketServer) [2025-09-01 17:10:52,317] INFO [SocketServer listenerType=ZK_BROKER, nodeId=0] Shutdown completed (kafka.network.SocketServer) [2025-09-01 17:10:52,363] INFO Metrics scheduler closed (org.apache.kafka.common.metrics.Metrics) [2025-09-01 17:10:52,363] INFO Metrics reporters closed (org.apache.kafka.common.metrics.Metrics) [2025-09-01 17:10:52,415] INFO Broker and topic stats closed (kafka.server.BrokerTopicStats) [2025-09-01 17:10:52,554] INFO App info kafka.server for 0 unregistered (org.apache.kafka.common.utils.AppInfoParser) [2025-09-01 17:10:52,610] INFO [KafkaServer id=0] shut down completed (kafka.server.KafkaServer) [2025-09-01 17:10:52,610] ERROR Exiting Kafka due to fatal exception during startup. (kafka.Kafka$) org.apache.zookeeper.KeeperException$NodeExistsException: KeeperErrorCode = NodeExists at org.apache.zookeeper.KeeperException.create(KeeperException.java:126) at kafka.zk.KafkaZkClient$CheckedEphemeral.getAfterNodeExists(KafkaZkClient.scala:2238) at kafka.zk.KafkaZkClient$CheckedEphemeral.create(KafkaZkClient.scala:2176) at kafka.zk.KafkaZkClient.checkedEphemeralCreate(KafkaZkClient.scala:2143) at kafka.zk.KafkaZkClient.registerBroker(KafkaZkClient.scala:110) at kafka.server.KafkaServer.startup(KafkaServer.scala:404) at kafka.Kafka$.main(Kafka.scala:112) at kafka.Kafka.main(Kafka.scala) [2025-09-01 17:10:52,953] INFO [KafkaServer id=0] shutting down (kafka.server.KafkaServer)
最新发布
09-02
讲解下面的代码: 1 /* 2 * Copyright (C) 2012 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 * 16 * Changes from Qualcomm Innovation Center are provided under the following license: 17 * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved. 18 * SPDX-License-Identifier: BSD-3-Clause-Clear 19 */ 20 21 /** 22 * Bluetooth A2DP StateMachine. There is one instance per remote device. 23 * - "Disconnected" and "Connected" are steady states. 24 * - "Connecting" and "Disconnecting" are transient states until the 25 * connection / disconnection is completed. 26 * 27 * 28 * (Disconnected) 29 * | ^ 30 * CONNECT | | DISCONNECTED 31 * V | 32 * (Connecting)<--->(Disconnecting) 33 * | ^ 34 * CONNECTED | | DISCONNECT 35 * V | 36 * (Connected) 37 * NOTES: 38 * - If state machine is in "Connecting" state and the remote device sends 39 * DISCONNECT request, the state machine transitions to "Disconnecting" state. 40 * - Similarly, if the state machine is in "Disconnecting" state and the remote device 41 * sends CONNECT request, the state machine transitions to "Connecting" state. 42 * 43 * DISCONNECT 44 * (Connecting) ---------------> (Disconnecting) 45 * <--------------- 46 * CONNECT 47 * 48 */ 49 50 package com.android.bluetooth.a2dp; 51 52 import static android.Manifest.permission.BLUETOOTH_CONNECT; 53 54 import android.bluetooth.BluetoothA2dp; 55 import android.bluetooth.BluetoothCodecConfig; 56 import android.bluetooth.BluetoothCodecStatus; 57 import android.bluetooth.BluetoothDevice; 58 import android.bluetooth.BluetoothProfile; 59 import android.content.Intent; 60 import android.os.Looper; 61 import android.os.Message; 62 import android.util.Log; 63 64 import com.android.bluetooth.BluetoothStatsLog; 65 import com.android.bluetooth.Utils; 66 import com.android.bluetooth.btservice.ProfileService; 67 import com.android.bluetooth.apm.ApmConstIntf; 68 import com.android.bluetooth.apm.DeviceProfileMapIntf; 69 import com.android.bluetooth.apm.MediaAudioIntf; 70 71 import com.android.internal.annotations.VisibleForTesting; 72 import com.android.internal.util.State; 73 import com.android.internal.util.StateMachine; 74 75 import java.io.FileDescriptor; 76 import java.io.PrintWriter; 77 import java.io.StringWriter; 78 import java.util.List; 79 import java.util.Scanner; 80 import java.lang.reflect.Method; 81 import android.os.SystemProperties; 82 import com.android.bluetooth.btservice.AdapterService; 83 84 final class A2dpStateMachine extends StateMachine { 85 private static final boolean DBG = true; 86 private static final String TAG = "A2dpStateMachine"; 87 88 static final int CONNECT = 1; 89 static final int DISCONNECT = 2; 90 @VisibleForTesting 91 static final int STACK_EVENT = 101; 92 private static final int CONNECT_TIMEOUT = 201; 93 94 // NOTE: the value is not "final" - it is modified in the unit tests 95 @VisibleForTesting 96 static int sConnectTimeoutMs = 30000; // 30s 97 98 private Disconnected mDisconnected; 99 private Connecting mConnecting; 100 private Disconnecting mDisconnecting; 101 private Connected mConnected; 102 private int mConnectionState = BluetoothProfile.STATE_DISCONNECTED; 103 private int mLastConnectionState = -1; 104 105 private A2dpService mA2dpService; 106 private A2dpNativeInterface mA2dpNativeInterface; 107 @VisibleForTesting 108 boolean mA2dpOffloadEnabled = false; 109 private final BluetoothDevice mDevice; 110 private boolean mIsPlaying = false; 111 private BluetoothCodecStatus mCodecStatus; 112 private boolean mCodecConfigUpdated = false; 113 114 A2dpStateMachine(BluetoothDevice device, A2dpService a2dpService, 115 A2dpNativeInterface a2dpNativeInterface, Looper looper) { 116 super(TAG, looper); 117 setDbg(DBG); 118 mDevice = device; 119 mCodecConfigUpdated = false; 120 mA2dpService = a2dpService; 121 mA2dpNativeInterface = a2dpNativeInterface; 122 123 mDisconnected = new Disconnected(); 124 mConnecting = new Connecting(); 125 mDisconnecting = new Disconnecting(); 126 mConnected = new Connected(); 127 128 addState(mDisconnected); 129 addState(mConnecting); 130 addState(mDisconnecting); 131 addState(mConnected); 132 mA2dpOffloadEnabled = mA2dpService.mA2dpOffloadEnabled; 133 134 setInitialState(mDisconnected); 135 } 136 137 static A2dpStateMachine make(BluetoothDevice device, A2dpService a2dpService, 138 A2dpNativeInterface a2dpNativeInterface, Looper looper) { 139 Log.i(TAG, "make for device " + device); 140 A2dpStateMachine a2dpSm = new A2dpStateMachine(device, a2dpService, a2dpNativeInterface, 141 looper); 142 a2dpSm.start(); 143 return a2dpSm; 144 } 145 146 public void doQuit() { 147 log("doQuit for device " + mDevice); 148 if (mIsPlaying) { 149 // Stop if auido is still playing 150 log("doQuit: stopped playing " + mDevice); 151 mIsPlaying = false; 152 mA2dpService.setAvrcpAudioState(BluetoothA2dp.STATE_NOT_PLAYING, mDevice); 153 broadcastAudioState(BluetoothA2dp.STATE_NOT_PLAYING, 154 BluetoothA2dp.STATE_PLAYING); 155 } 156 quitNow(); 157 } 158 159 public void cleanup() { 160 log("cleanup for device " + mDevice); 161 } 162 163 @VisibleForTesting 164 class Disconnected extends State { 165 @Override 166 public void enter() { 167 Message currentMessage = getCurrentMessage(); 168 Log.i(TAG, "Enter Disconnected(" + mDevice + "): " + (currentMessage == null ? "null" 169 : messageWhatToString(currentMessage.what))); 170 mCodecConfigUpdated = false; 171 synchronized (this) { 172 mConnectionState = BluetoothProfile.STATE_DISCONNECTED; 173 } 174 removeDeferredMessages(DISCONNECT); 175 176 if (mLastConnectionState != -1) { 177 // Don't broadcast during startup 178 if (mIsPlaying) { 179 Log.i(TAG, "Disconnected: stopped playing: " + mDevice); 180 mIsPlaying = false; 181 mA2dpService.setAvrcpAudioState(BluetoothA2dp.STATE_NOT_PLAYING, mDevice); 182 broadcastAudioState(BluetoothA2dp.STATE_NOT_PLAYING, 183 BluetoothA2dp.STATE_PLAYING); 184 } 185 broadcastConnectionState(mConnectionState, mLastConnectionState); 186 AdapterService adapterService = AdapterService.getAdapterService(); 187 if (adapterService.isVendorIntfEnabled() && 188 adapterService.isTwsPlusDevice(mDevice)) { 189 mA2dpService.updateTwsChannelMode(BluetoothA2dp.STATE_NOT_PLAYING, mDevice); 190 } 191 } 192 } 193 194 @Override 195 public void exit() { 196 Message currentMessage = getCurrentMessage(); 197 log("Exit Disconnected(" + mDevice + "): " + (currentMessage == null ? "null" 198 : messageWhatToString(currentMessage.what))); 199 mLastConnectionState = BluetoothProfile.STATE_DISCONNECTED; 200 } 201 202 @Override 203 public boolean processMessage(Message message) { 204 log("Disconnected process message(" + mDevice + "): " 205 + messageWhatToString(message.what)); 206 207 switch (message.what) { 208 case CONNECT: 209 Log.i(TAG, "Connecting to " + mDevice); 210 if (!mA2dpNativeInterface.connectA2dp(mDevice)) { 211 Log.e(TAG, "Disconnected: error connecting to " + mDevice); 212 break; 213 } 214 if (mA2dpService.okToConnect(mDevice, true)) { 215 transitionTo(mConnecting); 216 } else { 217 // Reject the request and stay in Disconnected state 218 Log.w(TAG, "Outgoing A2DP Connecting request rejected: " + mDevice); 219 } 220 break; 221 case DISCONNECT: 222 Log.w(TAG, "Disconnected: DISCONNECT ignored: " + mDevice); 223 break; 224 case STACK_EVENT: 225 A2dpStackEvent event = (A2dpStackEvent) message.obj; 226 log("Disconnected: stack event: " + event); 227 if (!mDevice.equals(event.device)) { 228 Log.wtf(TAG, "Device(" + mDevice + "): event mismatch: " + event); 229 } 230 switch (event.type) { 231 case A2dpStackEvent.EVENT_TYPE_CONNECTION_STATE_CHANGED: 232 processConnectionEvent(event.valueInt); 233 break; 234 case A2dpStackEvent.EVENT_TYPE_CODEC_CONFIG_CHANGED: 235 processCodecConfigEvent(event.codecStatus); 236 break; 237 default: 238 Log.e(TAG, "Disconnected: ignoring stack event: " + event); 239 break; 240 } 241 break; 242 default: 243 return NOT_HANDLED; 244 } 245 return HANDLED; 246 } 247 248 // in Disconnected state 249 private void processConnectionEvent(int event) { 250 switch (event) { 251 case A2dpStackEvent.CONNECTION_STATE_DISCONNECTED: 252 Log.w(TAG, "Ignore A2DP DISCONNECTED event: " + mDevice); 253 break; 254 case A2dpStackEvent.CONNECTION_STATE_CONNECTING: 255 if (mA2dpService.okToConnect(mDevice, false)) { 256 Log.i(TAG, "Incoming A2DP Connecting request accepted: " + mDevice); 257 transitionTo(mConnecting); 258 if (mA2dpService.isQtiLeAudioEnabled()) { 259 MediaAudioIntf mMediaAudio = MediaAudioIntf.get(); 260 mMediaAudio.autoConnect(mDevice); 261 } 262 } else { 263 // Reject the connection and stay in Disconnected state itself 264 Log.w(TAG, "Incoming A2DP Connecting request rejected: " + mDevice); 265 mA2dpNativeInterface.disconnectA2dp(mDevice); 266 } 267 break; 268 case A2dpStackEvent.CONNECTION_STATE_CONNECTED: 269 Log.w(TAG, "A2DP Connected from Disconnected state: " + mDevice); 270 if (mA2dpService.okToConnect(mDevice, false)) { 271 Log.i(TAG, "Incoming A2DP Connected request accepted: " + mDevice); 272 transitionTo(mConnected); 273 if (mA2dpService.isQtiLeAudioEnabled()) { 274 MediaAudioIntf mMediaAudio = MediaAudioIntf.get(); 275 mMediaAudio.autoConnect(mDevice); 276 } 277 } else { 278 // Reject the connection and stay in Disconnected state itself 279 Log.w(TAG, "Incoming A2DP Connected request rejected: " + mDevice); 280 mA2dpNativeInterface.disconnectA2dp(mDevice); 281 } 282 break; 283 case A2dpStackEvent.CONNECTION_STATE_DISCONNECTING: 284 Log.w(TAG, "Ignore A2DP DISCONNECTING event: " + mDevice); 285 break; 286 default: 287 Log.e(TAG, "Incorrect event: " + event + " device: " + mDevice); 288 break; 289 } 290 } 291 } 292 293 @VisibleForTesting 294 class Connecting extends State { 295 @Override 296 public void enter() { 297 Message currentMessage = getCurrentMessage(); 298 Log.i(TAG, "Enter Connecting(" + mDevice + "): " + (currentMessage == null ? "null" 299 : messageWhatToString(currentMessage.what))); 300 sendMessageDelayed(CONNECT_TIMEOUT, sConnectTimeoutMs); 301 synchronized (this) { 302 mConnectionState = BluetoothProfile.STATE_CONNECTING; 303 } 304 broadcastConnectionState(mConnectionState, mLastConnectionState); 305 } 306 307 @Override 308 public void exit() { 309 Message currentMessage = getCurrentMessage(); 310 log("Exit Connecting(" + mDevice + "): " + (currentMessage == null ? "null" 311 : messageWhatToString(currentMessage.what))); 312 mLastConnectionState = BluetoothProfile.STATE_CONNECTING; 313 removeMessages(CONNECT_TIMEOUT); 314 } 315 316 @Override 317 public boolean processMessage(Message message) { 318 log("Connecting process message(" + mDevice + "): " 319 + messageWhatToString(message.what)); 320 321 switch (message.what) { 322 case CONNECT: 323 deferMessage(message); 324 break; 325 case CONNECT_TIMEOUT: { 326 Log.w(TAG, "Connecting connection timeout: " + mDevice); 327 mA2dpNativeInterface.disconnectA2dp(mDevice); 328 A2dpStackEvent event = 329 new A2dpStackEvent(A2dpStackEvent.EVENT_TYPE_CONNECTION_STATE_CHANGED); 330 event.device = mDevice; 331 event.valueInt = A2dpStackEvent.CONNECTION_STATE_DISCONNECTED; 332 sendMessage(STACK_EVENT, event); 333 break; 334 } 335 case DISCONNECT: 336 // Cancel connection 337 Log.i(TAG, "Connecting: connection canceled to " + mDevice); 338 mA2dpNativeInterface.disconnectA2dp(mDevice); 339 transitionTo(mDisconnected); 340 break; 341 case STACK_EVENT: 342 A2dpStackEvent event = (A2dpStackEvent) message.obj; 343 log("Connecting: stack event: " + event); 344 if (!mDevice.equals(event.device)) { 345 Log.wtf(TAG, "Device(" + mDevice + "): event mismatch: " + event); 346 } 347 switch (event.type) { 348 case A2dpStackEvent.EVENT_TYPE_CONNECTION_STATE_CHANGED: 349 processConnectionEvent(event.valueInt); 350 break; 351 case A2dpStackEvent.EVENT_TYPE_CODEC_CONFIG_CHANGED: 352 processCodecConfigEvent(event.codecStatus); 353 break; 354 case A2dpStackEvent.EVENT_TYPE_AUDIO_STATE_CHANGED: 355 break; 356 default: 357 Log.e(TAG, "Connecting: ignoring stack event: " + event); 358 break; 359 } 360 break; 361 default: 362 return NOT_HANDLED; 363 } 364 return HANDLED; 365 } 366 367 // in Connecting state 368 private void processConnectionEvent(int event) { 369 switch (event) { 370 case A2dpStackEvent.CONNECTION_STATE_DISCONNECTED: 371 Log.w(TAG, "Connecting device disconnected: " + mDevice); 372 transitionTo(mDisconnected); 373 break; 374 case A2dpStackEvent.CONNECTION_STATE_CONNECTED: 375 transitionTo(mConnected); 376 break; 377 case A2dpStackEvent.CONNECTION_STATE_CONNECTING: 378 // Ignored - probably an event that the outgoing connection was initiated 379 break; 380 case A2dpStackEvent.CONNECTION_STATE_DISCONNECTING: 381 Log.w(TAG, "Connecting interrupted: device is disconnecting: " + mDevice); 382 transitionTo(mDisconnecting); 383 break; 384 default: 385 Log.e(TAG, "Incorrect event: " + event); 386 break; 387 } 388 } 389 } 390 391 @VisibleForTesting 392 class Disconnecting extends State { 393 @Override 394 public void enter() { 395 Message currentMessage = getCurrentMessage(); 396 Log.i(TAG, "Enter Disconnecting(" + mDevice + "): " + (currentMessage == null ? "null" 397 : messageWhatToString(currentMessage.what))); 398 mCodecConfigUpdated = false; 399 sendMessageDelayed(CONNECT_TIMEOUT, sConnectTimeoutMs); 400 synchronized (this) { 401 mConnectionState = BluetoothProfile.STATE_DISCONNECTING; 402 } 403 broadcastConnectionState(mConnectionState, mLastConnectionState); 404 } 405 406 @Override 407 public void exit() { 408 Message currentMessage = getCurrentMessage(); 409 log("Exit Disconnecting(" + mDevice + "): " + (currentMessage == null ? "null" 410 : messageWhatToString(currentMessage.what))); 411 mLastConnectionState = BluetoothProfile.STATE_DISCONNECTING; 412 removeMessages(CONNECT_TIMEOUT); 413 } 414 415 @Override 416 public boolean processMessage(Message message) { 417 log("Disconnecting process message(" + mDevice + "): " 418 + messageWhatToString(message.what)); 419 420 switch (message.what) { 421 case CONNECT: 422 deferMessage(message); 423 break; 424 case CONNECT_TIMEOUT: { 425 Log.w(TAG, "Disconnecting connection timeout: " + mDevice); 426 mA2dpNativeInterface.disconnectA2dp(mDevice); 427 A2dpStackEvent event = 428 new A2dpStackEvent(A2dpStackEvent.EVENT_TYPE_CONNECTION_STATE_CHANGED); 429 event.device = mDevice; 430 event.valueInt = A2dpStackEvent.CONNECTION_STATE_DISCONNECTED; 431 sendMessage(STACK_EVENT, event); 432 break; 433 } 434 case DISCONNECT: 435 deferMessage(message); 436 break; 437 case STACK_EVENT: 438 A2dpStackEvent event = (A2dpStackEvent) message.obj; 439 log("Disconnecting: stack event: " + event); 440 if (!mDevice.equals(event.device)) { 441 Log.wtf(TAG, "Device(" + mDevice + "): event mismatch: " + event); 442 } 443 switch (event.type) { 444 case A2dpStackEvent.EVENT_TYPE_CONNECTION_STATE_CHANGED: 445 processConnectionEvent(event.valueInt); 446 break; 447 case A2dpStackEvent.EVENT_TYPE_CODEC_CONFIG_CHANGED: 448 processCodecConfigEvent(event.codecStatus); 449 break; 450 case A2dpStackEvent.EVENT_TYPE_AUDIO_STATE_CHANGED: 451 default: 452 Log.e(TAG, "Disconnecting: ignoring stack event: " + event); 453 break; 454 } 455 break; 456 default: 457 return NOT_HANDLED; 458 } 459 return HANDLED; 460 } 461 462 // in Disconnecting state 463 private void processConnectionEvent(int event) { 464 switch (event) { 465 case A2dpStackEvent.CONNECTION_STATE_DISCONNECTED: 466 Log.i(TAG, "Disconnected: " + mDevice); 467 transitionTo(mDisconnected); 468 break; 469 case A2dpStackEvent.CONNECTION_STATE_CONNECTED: 470 if (mA2dpService.okToConnect(mDevice, false)) { 471 Log.w(TAG, "Disconnecting interrupted: device is connected: " + mDevice); 472 transitionTo(mConnected); 473 if (mA2dpService.isQtiLeAudioEnabled()) { 474 MediaAudioIntf mMediaAudio = MediaAudioIntf.get(); 475 mMediaAudio.autoConnect(mDevice); 476 } 477 } else { 478 // Reject the connection and stay in Disconnecting state 479 Log.w(TAG, "Incoming A2DP Connected request rejected: " + mDevice); 480 mA2dpNativeInterface.disconnectA2dp(mDevice); 481 } 482 break; 483 case A2dpStackEvent.CONNECTION_STATE_CONNECTING: 484 if (mA2dpService.okToConnect(mDevice, false)) { 485 Log.i(TAG, "Disconnecting interrupted: try to reconnect: " + mDevice); 486 transitionTo(mConnecting); 487 if (mA2dpService.isQtiLeAudioEnabled()) { 488 MediaAudioIntf mMediaAudio = MediaAudioIntf.get(); 489 mMediaAudio.autoConnect(mDevice); 490 } 491 } else { 492 // Reject the connection and stay in Disconnecting state 493 Log.w(TAG, "Incoming A2DP Connecting request rejected: " + mDevice); 494 mA2dpNativeInterface.disconnectA2dp(mDevice); 495 } 496 break; 497 case A2dpStackEvent.CONNECTION_STATE_DISCONNECTING: 498 // We are already disconnecting, do nothing 499 Log.i(TAG, " already disconnecting, do nothing "); 500 break; 501 default: 502 Log.e(TAG, "Incorrect event: " + event); 503 break; 504 } 505 } 506 } 507 508 @VisibleForTesting 509 class Connected extends State { 510 @Override 511 public void enter() { 512 Message currentMessage = getCurrentMessage(); 513 Log.i(TAG, "Enter Connected(" + mDevice + "): " + (currentMessage == null ? "null" 514 : messageWhatToString(currentMessage.what))); 515 synchronized (this) { 516 mConnectionState = BluetoothProfile.STATE_CONNECTED; 517 } 518 removeDeferredMessages(CONNECT); 519 DeviceProfileMapIntf dpm = DeviceProfileMapIntf.getDeviceProfileMapInstance(); 520 dpm.profileConnectionUpdate(mDevice, ApmConstIntf.AudioFeatures.MEDIA_AUDIO, 521 ApmConstIntf.AudioProfiles.A2DP, true); 522 // Each time a device connects, we want to re-check if it supports optional 523 // codecs (perhaps it's had a firmware update, etc.) and save that state if 524 // it differs from what we had saved before. 525 mA2dpService.updateOptionalCodecsSupport(mDevice); 526 broadcastConnectionState(mConnectionState, mLastConnectionState); 527 // Upon connected, the audio starts out as stopped 528 broadcastAudioState(BluetoothA2dp.STATE_NOT_PLAYING, 529 BluetoothA2dp.STATE_PLAYING); 530 } 531 532 @Override 533 public void exit() { 534 Message currentMessage = getCurrentMessage(); 535 log("Exit Connected(" + mDevice + "): " + (currentMessage == null ? "null" 536 : messageWhatToString(currentMessage.what))); 537 mLastConnectionState = BluetoothProfile.STATE_CONNECTED; 538 } 539 540 @Override 541 public boolean processMessage(Message message) { 542 log("Connected process message(" + mDevice + "): " + messageWhatToString(message.what)); 543 544 switch (message.what) { 545 case CONNECT: 546 Log.w(TAG, "Connected: CONNECT ignored: " + mDevice); 547 break; 548 case DISCONNECT: { 549 Log.i(TAG, "Disconnecting from " + mDevice); 550 if (!mA2dpNativeInterface.disconnectA2dp(mDevice)) { 551 // If error in the native stack, transition directly to Disconnected state. 552 Log.e(TAG, "Connected: error disconnecting from " + mDevice); 553 transitionTo(mDisconnected); 554 break; 555 } 556 transitionTo(mDisconnecting); 557 } 558 break; 559 case STACK_EVENT: 560 A2dpStackEvent event = (A2dpStackEvent) message.obj; 561 log("Connected: stack event: " + event); 562 if (!mDevice.equals(event.device)) { 563 Log.wtf(TAG, "Device(" + mDevice + "): event mismatch: " + event); 564 } 565 switch (event.type) { 566 case A2dpStackEvent.EVENT_TYPE_CONNECTION_STATE_CHANGED: 567 processConnectionEvent(event.valueInt); 568 break; 569 case A2dpStackEvent.EVENT_TYPE_AUDIO_STATE_CHANGED: 570 processAudioStateEvent(event.valueInt); 571 break; 572 case A2dpStackEvent.EVENT_TYPE_CODEC_CONFIG_CHANGED: 573 processCodecConfigEvent(event.codecStatus); 574 break; 575 default: 576 Log.e(TAG, "Connected: ignoring stack event: " + event); 577 break; 578 } 579 break; 580 default: 581 return NOT_HANDLED; 582 } 583 return HANDLED; 584 } 585 586 // in Connected state 587 private void processConnectionEvent(int event) { 588 switch (event) { 589 case A2dpStackEvent.CONNECTION_STATE_DISCONNECTED: 590 Log.i(TAG, "Disconnected from " + mDevice); 591 transitionTo(mDisconnected); 592 break; 593 case A2dpStackEvent.CONNECTION_STATE_CONNECTED: 594 Log.w(TAG, "Ignore A2DP CONNECTED event: " + mDevice); 595 break; 596 case A2dpStackEvent.CONNECTION_STATE_CONNECTING: 597 Log.w(TAG, "Ignore A2DP CONNECTING event: " + mDevice); 598 break; 599 case A2dpStackEvent.CONNECTION_STATE_DISCONNECTING: 600 Log.i(TAG, "Disconnecting from " + mDevice); 601 transitionTo(mDisconnecting); 602 break; 603 default: 604 Log.e(TAG, "Connection State Device: " + mDevice + " bad event: " + event); 605 break; 606 } 607 } 608 609 // in Connected state 610 private void processAudioStateEvent(int state) { 611 Log.i(TAG, "Connected: processAudioStateEvent: state: " + state + "mIsPlaying: " + mIsPlaying); 612 switch (state) { 613 case A2dpStackEvent.AUDIO_STATE_STARTED: 614 synchronized (this) { 615 if (!mIsPlaying) { 616 Log.i(TAG, "Connected: started playing: " + mDevice); 617 mIsPlaying = true; 618 mA2dpService.setAvrcpAudioState(BluetoothA2dp.STATE_PLAYING, mDevice); 619 broadcastAudioState(BluetoothA2dp.STATE_PLAYING, 620 BluetoothA2dp.STATE_NOT_PLAYING); 621 Log.i(TAG,"state:AUDIO_STATE_STARTED"); 622 } 623 AdapterService adapterService = AdapterService.getAdapterService(); 624 if (adapterService.isVendorIntfEnabled() && 625 adapterService.isTwsPlusDevice(mDevice)) { 626 mA2dpService.updateTwsChannelMode(BluetoothA2dp.STATE_PLAYING, mDevice); 627 } 628 } 629 break; 630 case A2dpStackEvent.AUDIO_STATE_REMOTE_SUSPEND: 631 case A2dpStackEvent.AUDIO_STATE_STOPPED: 632 synchronized (this) { 633 if (mIsPlaying) { 634 Log.i(TAG, "Connected: stopped playing: " + mDevice); 635 mIsPlaying = false; 636 mA2dpService.setAvrcpAudioState(BluetoothA2dp.STATE_NOT_PLAYING, mDevice); 637 broadcastAudioState(BluetoothA2dp.STATE_NOT_PLAYING, 638 BluetoothA2dp.STATE_PLAYING); 639 mA2dpService.setGamingMode(mDevice, false); 640 } 641 } 642 break; 643 default: 644 Log.e(TAG, "Audio State Device: " + mDevice + " bad state: " + state); 645 break; 646 } 647 } 648 } 649 650 int getConnectionState() { 651 return mConnectionState; 652 } 653 654 BluetoothDevice getDevice() { 655 return mDevice; 656 } 657 658 boolean isConnected() { 659 synchronized (this) { 660 return (mConnectionState == BluetoothProfile.STATE_CONNECTED); 661 } 662 } 663 664 boolean isPlaying() { 665 synchronized (this) { 666 return mIsPlaying; 667 } 668 } 669 670 BluetoothCodecStatus getCodecStatus() { 671 synchronized (this) { 672 return mCodecStatus; 673 } 674 } 675 676 // NOTE: This event is processed in any state 677 @VisibleForTesting 678 void processCodecConfigEvent(BluetoothCodecStatus newCodecStatus) { 679 BluetoothCodecConfig prevCodecConfig = null; 680 BluetoothCodecStatus prevCodecStatus = mCodecStatus; 681 682 int new_codec_type = newCodecStatus.getCodecConfig().getCodecType(); 683 684 // Split A2dp will be enabled by default 685 boolean isSplitA2dpEnabled = true; 686 AdapterService adapterService = AdapterService.getAdapterService(); 687 Object objStreamAudioService = null; 688 689 if (adapterService != null){ 690 isSplitA2dpEnabled = adapterService.isSplitA2dpEnabled(); 691 Log.v(TAG,"isSplitA2dpEnabled: " + isSplitA2dpEnabled); 692 } else { 693 Log.e(TAG,"adapterService is null"); 694 } 695 696 Log.w(TAG,"processCodecConfigEvent: new_codec_type = " + new_codec_type); 697 698 if (isSplitA2dpEnabled) { 699 if (new_codec_type == BluetoothCodecConfig.SOURCE_QVA_CODEC_TYPE_MAX) { 700 if (adapterService.isVendorIntfEnabled() && 701 adapterService.isTwsPlusDevice(mDevice)) { 702 Log.d(TAG,"TWSP device streaming,not calling reconfig"); 703 mCodecStatus = newCodecStatus; 704 return; 705 } 706 mA2dpService.broadcastReconfigureA2dp(); 707 Log.w(TAG,"Split A2dp enabled rcfg send to Audio for codec max"); 708 return; 709 } 710 } 711 synchronized (this) { 712 if (mCodecStatus != null) { 713 prevCodecConfig = mCodecStatus.getCodecConfig(); 714 } 715 mCodecStatus = newCodecStatus; 716 } 717 if (DBG) { 718 Log.d(TAG, "A2DP Codec Config: " + prevCodecConfig + "->" 719 + newCodecStatus.getCodecConfig()); 720 for (BluetoothCodecConfig codecConfig : 721 newCodecStatus.getCodecsLocalCapabilities()) { 722 Log.d(TAG, "A2DP Codec Local Capability: " + codecConfig); 723 } 724 for (BluetoothCodecConfig codecConfig : 725 newCodecStatus.getCodecsSelectableCapabilities()) { 726 Log.d(TAG, "A2DP Codec Selectable Capability: " + codecConfig); 727 } 728 } 729 730 if (isConnected() && !sameSelectableCodec(prevCodecStatus, mCodecStatus)) { 731 // Remote selectable codec could be changed if codec config changed 732 // in connected state, we need to re-check optional codec status 733 // for this codec change event. 734 mA2dpService.updateOptionalCodecsSupport(mDevice); 735 } 736 Log.d(TAG, " mA2dpOffloadEnabled: " + mA2dpOffloadEnabled); 737 if (mA2dpOffloadEnabled) { 738 boolean update = false; 739 BluetoothCodecConfig newCodecConfig = mCodecStatus.getCodecConfig(); 740 if ((prevCodecConfig != null) 741 && (prevCodecConfig.getCodecType() != newCodecConfig.getCodecType())) { 742 Log.d(TAG, " previous codec is different from new codec "); 743 update = true; 744 } else if (!newCodecConfig.sameAudioFeedingParameters(prevCodecConfig)) { 745 Log.d(TAG, " codec config parameters mismatched from previous config "); 746 update = true; 747 } else if ((newCodecConfig.getCodecType() 748 == BluetoothCodecConfig.SOURCE_CODEC_TYPE_LDAC) 749 && (prevCodecConfig != null) 750 && (prevCodecConfig.getCodecSpecific1() 751 != newCodecConfig.getCodecSpecific1())) { 752 Log.d(TAG, "LDAC: codec config parameters mismatched from previous config "); 753 update = true; 754 } else if (prevCodecStatus != null && 755 newCodecStatus.getCodecsSelectableCapabilities().size() != 756 prevCodecStatus.getCodecsSelectableCapabilities().size()){ 757 Log.d(TAG, " codec selectable caps mismatched from previous config "); 758 update = true; 759 } else if (!mCodecConfigUpdated) { 760 Log.d(TAG, " mCodecConfigUpdated is false, codecConfigUpdated is required"); 761 update = true; 762 } 763 764 if ((newCodecConfig.getCodecType() 765 == BluetoothCodecConfig.SOURCE_CODEC_TYPE_APTX_ADAPTIVE)) { 766 Log.d(TAG, "processCodecConfigEvent, APTX ADAPTIVE: reset Low Latency mode "); 767 try { 768 Class streamAudioService = Class.forName("com.android.bluetooth.apm.StreamAudioService"); 769 Method method = streamAudioService.getDeclaredMethod("getStreamAudioService"); 770 objStreamAudioService = method.invoke(null); 771 if (objStreamAudioService != null) { 772 Log.d(TAG, " processCodecConfigEvent, objStreamAudioService not null:"); 773 } else { 774 Log.d(TAG, " processCodecConfigEvent, objStreamAudioService is null:"); 775 } 776 } catch (Exception ex) { 777 Log.w(TAG, ex); 778 } 779 try { 780 Class streamAudioService = 781 Class.forName("com.android.bluetooth.apm.StreamAudioService"); 782 Method method = streamAudioService.getDeclaredMethod("resetLowLatencyMode"); 783 if (objStreamAudioService != null) { 784 Log.d(TAG, " processCodecConfigEvent, invoke resetLowLatencyMode "); 785 method.invoke(objStreamAudioService); 786 } 787 } catch (Exception ex) { 788 Log.w(TAG, ex); 789 } 790 } 791 Log.d(TAG, " update: " + update); 792 if (update) { 793 mA2dpService.codecConfigUpdated(mDevice, mCodecStatus, false); 794 mCodecConfigUpdated = true; 795 } 796 return; 797 } 798 799 Log.d(TAG, " isSplitA2dpEnabled: " + isSplitA2dpEnabled); 800 if (!isSplitA2dpEnabled) { 801 boolean isUpdateRequired = false; 802 if ((prevCodecConfig != null) && (prevCodecConfig.getCodecType() != new_codec_type)) { 803 Log.d(TAG, "previous codec is differs from new codec"); 804 isUpdateRequired = true; 805 } else if (!newCodecStatus.getCodecConfig().sameAudioFeedingParameters(prevCodecConfig)) { 806 Log.d(TAG, "codec config parameters mismatched with previous config: "); 807 isUpdateRequired = true; 808 } else if ((newCodecStatus.getCodecConfig().getCodecType() 809 == BluetoothCodecConfig.SOURCE_CODEC_TYPE_LDAC) 810 && (prevCodecConfig != null) 811 && (prevCodecConfig.getCodecSpecific1() 812 != newCodecStatus.getCodecConfig().getCodecSpecific1())) { 813 Log.d(TAG, "LDAC: codec config parameters mismatched with previous config: "); 814 isUpdateRequired = true; 815 } else if(!mCodecConfigUpdated) { 816 Log.d(TAG, " mCodecConfigUpdated is false, codecConfigUpdated is required "); 817 isUpdateRequired = true; 818 } 819 Log.d(TAG, "isUpdateRequired: " + isUpdateRequired); 820 //update MM only when previous and current codec config has been changed 821 // OR reconnection has happened 822 if (isUpdateRequired) { 823 mA2dpService.codecConfigUpdated(mDevice, mCodecStatus, false); 824 mCodecConfigUpdated = true; 825 } 826 } 827 } 828 829 // This method does not check for error conditon (newState == prevState) 830 private void broadcastConnectionState(int newState, int prevState) { 831 log("Connection state " + mDevice + ": " + profileStateToString(prevState) 832 + "->" + profileStateToString(newState)); 833 834 if(mA2dpService.isQtiLeAudioEnabled() || ApmConstIntf.getAospLeaEnabled()) { 835 mA2dpService.updateConnState(mDevice, newState); 836 } 837 838 if (!mA2dpService.isQtiLeAudioEnabled()) { 839 Intent intent = new Intent(BluetoothA2dp.ACTION_CONNECTION_STATE_CHANGED); 840 intent.putExtra(BluetoothProfile.EXTRA_PREVIOUS_STATE, prevState); 841 intent.putExtra(BluetoothProfile.EXTRA_STATE, newState); 842 intent.putExtra(BluetoothDevice.EXTRA_DEVICE, mDevice); 843 intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT 844 | Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND); 845 mA2dpService.sendBroadcast(intent, BLUETOOTH_CONNECT, 846 Utils.getTempAllowlistBroadcastOptions()); 847 } 848 } 849 850 private void broadcastAudioState(int newState, int prevState) { 851 log("A2DP Playing state : device: " + mDevice + " State:" + audioStateToString(prevState) 852 + "->" + audioStateToString(newState)); 853 854 mA2dpService.updateStreamState(mDevice, newState); 855 856 if(mA2dpService.isQtiLeAudioEnabled()) { 857 return; 858 } 859 860 BluetoothStatsLog.write(BluetoothStatsLog.BLUETOOTH_A2DP_PLAYBACK_STATE_CHANGED, newState); 861 Intent intent = new Intent(BluetoothA2dp.ACTION_PLAYING_STATE_CHANGED); 862 intent.putExtra(BluetoothDevice.EXTRA_DEVICE, mDevice); 863 intent.putExtra(BluetoothProfile.EXTRA_PREVIOUS_STATE, prevState); 864 intent.putExtra(BluetoothProfile.EXTRA_STATE, newState); 865 intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT); 866 mA2dpService.sendBroadcast(intent, BLUETOOTH_CONNECT, 867 Utils.getTempAllowlistBroadcastOptions()); 868 } 869 870 @Override 871 protected String getLogRecString(Message msg) { 872 StringBuilder builder = new StringBuilder(); 873 builder.append(messageWhatToString(msg.what)); 874 builder.append(": "); 875 builder.append("arg1=") 876 .append(msg.arg1) 877 .append(", arg2=") 878 .append(msg.arg2) 879 .append(", obj=") 880 .append(msg.obj); 881 return builder.toString(); 882 } 883 884 private static boolean sameSelectableCodec(BluetoothCodecStatus prevCodecStatus, 885 BluetoothCodecStatus newCodecStatus) { 886 if (prevCodecStatus == null || newCodecStatus == null) { 887 return false; 888 } 889 List<BluetoothCodecConfig> c1 = prevCodecStatus.getCodecsSelectableCapabilities(); 890 List<BluetoothCodecConfig> c2 = newCodecStatus.getCodecsSelectableCapabilities(); 891 if (c1 == null) { 892 return (c2 == null); 893 } 894 if (c2 == null) { 895 return false; 896 } 897 if (c1.size() != c2.size()) { 898 return false; 899 } 900 return c1.containsAll(c2); 901 } 902 903 private static String messageWhatToString(int what) { 904 switch (what) { 905 case CONNECT: 906 return "CONNECT"; 907 case DISCONNECT: 908 return "DISCONNECT"; 909 case STACK_EVENT: 910 return "STACK_EVENT"; 911 case CONNECT_TIMEOUT: 912 return "CONNECT_TIMEOUT"; 913 default: 914 break; 915 } 916 return Integer.toString(what); 917 } 918 919 private static String profileStateToString(int state) { 920 switch (state) { 921 case BluetoothProfile.STATE_DISCONNECTED: 922 return "DISCONNECTED"; 923 case BluetoothProfile.STATE_CONNECTING: 924 return "CONNECTING"; 925 case BluetoothProfile.STATE_CONNECTED: 926 return "CONNECTED"; 927 case BluetoothProfile.STATE_DISCONNECTING: 928 return "DISCONNECTING"; 929 default: 930 break; 931 } 932 return Integer.toString(state); 933 } 934 935 private static String audioStateToString(int state) { 936 switch (state) { 937 case BluetoothA2dp.STATE_PLAYING: 938 return "PLAYING"; 939 case BluetoothA2dp.STATE_NOT_PLAYING: 940 return "NOT_PLAYING"; 941 default: 942 break; 943 } 944 return Integer.toString(state); 945 } 946 947 public void dump(StringBuilder sb) { 948 ProfileService.println(sb, "mDevice: " + mDevice); 949 ProfileService.println(sb, " StateMachine: " + this.toString()); 950 ProfileService.println(sb, " mIsPlaying: " + mIsPlaying); 951 synchronized (this) { 952 if (mCodecStatus != null) { 953 ProfileService.println(sb, " mCodecConfig: " + mCodecStatus.getCodecConfig()); 954 } 955 } 956 // Dump the state machine logs 957 StringWriter stringWriter = new StringWriter(); 958 PrintWriter printWriter = new PrintWriter(stringWriter); 959 super.dump(new FileDescriptor(), printWriter, new String[]{}); 960 printWriter.flush(); 961 stringWriter.flush(); 962 ProfileService.println(sb, " StateMachineLog:"); 963 Scanner scanner = new Scanner(stringWriter.toString()); 964 while (scanner.hasNextLine()) { 965 String line = scanner.nextLine(); 966 ProfileService.println(sb, " " + line); 967 } 968 scanner.close(); 969 } 970 971 @Override 972 protected void log(String msg) { 973 if (DBG) { 974 super.log(msg); 975 } 976 } 977 }
08-30
Debian系统非Docker安装nextcloud,完成后自动跳转页面提示: 500 Internal Server Error nginx/1.18.0 nginx/error.log内容如下 2025/06/09 11:45:17 [error] 32990#32990: *3 rewrite or internal redirection cycle while internally redirecting to "/index.php/index.php/csrftoken", client: 192.168.60.200, server: , request: "GET /index.php/csrftoken HTTP/1.1", host: "192.168.60.200" 2025/06/09 12:00:17 [error] 32990#32990: *4 rewrite or internal redirection cycle while internally redirecting to "/index.php/index.php/csrftoken", client: 192.168.60.200, server: , request: "GET /index.php/csrftoken HTTP/1.1", host: "192.168.60.200" 2025/06/09 12:15:20 [error] 32990#32990: *5 rewrite or internal redirection cycle while internally redirecting to "/index.php/index.php/csrftoken", client: 192.168.60.200, server: , request: "GET /index.php/csrftoken HTTP/1.1", host: "192.168.60.200" 2025/06/09 12:30:20 [error] 32990#32990: *6 rewrite or internal redirection cycle while internally redirecting to "/index.php/index.php/csrftoken", client: 192.168.60.200, server: , request: "GET /index.php/csrftoken HTTP/1.1", host: "192.168.60.200" 2025/06/09 12:42:02 [error] 32990#32990: *11 rewrite or internal redirection cycle while internally redirecting to "/index.php/index.php/core/apps/recommended", client: 192.168.60.200, server: , request: "GET /index.php/core/apps/recommended HTTP/1.1", host: "192.168.60.200" 2025/06/09 12:43:10 [error] 32990#32990: *13 rewrite or internal redirection cycle while internally redirecting to "/index.php/index.php/apps/dashboard/", client: 192.168.60.200, server: , request: "GET /index.php/apps/dashboard/ HTTP/1.1", host: "192.168.60.200" 2025/06/09 12:43:23 [error] 32990#32990: *15 rewrite or internal redirection cycle while internally redirecting to "/index.php/index.php/apps/dashboard/", client: 192.168.60.200, server: , request: "GET /index.php/apps/dashboard/ HTTP/1.1", host: "192.168.60.200" 2025/06/09 13:12:22 [error] 38605#38605: *1 rewrite or internal redirection cycle while internally redirecting to "/index.php/index.php/apps/dashboard/", client: 192.168.60.200, server: , request: "GET /index.php/apps/dashboard/ HTTP/1.1", host: "192.168.60.200" 2025/06/09 13:36:09 [error] 38605#38605: *3 rewrite or internal redirection cycle while internally redirecting to "/index.php/index.php/apps/dashboard/", client: 192.168.60.200, server: , request: "GET /index.php/apps/dashboard/ HTTP/1.1", host: "192.168.60.200" 2025/06/09 13:36:16 [error] 38605#38605: *4 rewrite or internal redirection cycle while internally redirecting to "/index.php/index.php/apps/dashboard/", client: 192.168.60.200, server: , request: "GET /index.php/apps/dashboard/ HTTP/1.1", host: "192.168.60.200" 2025/06/09 13:53:56 [error] 38605#38605: *7 rewrite or internal redirection cycle while internally redirecting to "/index.php/index.php/apps/dashboard/", client: 192.168.60.200, server: , request: "GET /index.php/apps/dashboard/ HTTP/1.1", host: "192.168.60.200" 2025/06/09 13:53:56 [error] 38605#38605: *9 open() "/var/www/nextcloud/favicon.ico" failed (2: No such file or directory), client: 192.168.60.200, server: , request: "GET /favicon.ico HTTP/1.1", host: "192.168.60.200", referrer: "http://192.168.60.200/index.php/apps/dashboard/"
06-10
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值