skip to main content
10.1145/3650212.3680319acmconferencesArticle/Chapter ViewAbstractPublication PagesisstaConference Proceedingsconference-collections
research-article
Open access

Preserving Reactiveness: Understanding and Improving the Debugging Practice of Blocking-Call Bugs

Published: 11 September 2024 Publication History

Abstract

Reactive programming reacts to data items as they occur, rather than waiting for them to complete. This programming paradigm is widely used in asynchronous and event-driven scenarios, such as web applications, microservices, real-time data processing, IoT, interactive UIs, and big data. When done right, it can offer greater responsiveness without extra resource usage. However, this also requires a thorough understanding of asynchronous and non-blocking coding, posing a learning curve for developers new to this style of programming. In this work, we analyze issues reported in reactive applications and explore their corresponding fixes. Our investigation results reveal that (1) developers often do not fix or ignore reactiveness bugs as compared to other bug types, and (2) this tendency is most pronounced for blocking-call bugs -- bugs that block the execution of the program to wait for the operations (typically I/O operations) to finish, wasting CPU and memory resources. To improve the debugging practice of such blocking bugs, we develop a pattern-based proactive program repair technique and obtain 30 patches, which we submit to the developers. In addition, we hypothesize that the low patch acceptance rate for reactiveness bugs is due to the difficulty of assessing the patches. This is in contrast to functionality bugs, where the correctness of the patches can be assessed by running test cases. To assess our hypothesis, we split our patches into two groups: one with performance improvement evidence and the other without. It turns out that the patches are more likely to be accepted when submitted with performance improvement evidence.

References

[1]
[n. d.]. Preserving Reactiveness: Understanding and Improving the Debugging Practice of Blocking-call Bugs — Replication Package. https://figshare.com/s/0b7e78405b0b86f6cbfb [Online; accessed 31. Jul. 2023]
[2]
2023. https://www.diva-portal.org/smash/get/diva2:1763111/FULLTEXT01.pdf [Online; accessed 30. Jul. 2023]
[3]
2023. About Java Flight Recorder. https://docs.oracle.com/javacomponents/jmc-5-4/jfr-runtime-guide/about.htm##JFRUH170 [Online; accessed 30. Jul. 2023]
[4]
2023. aws-sdk-java-v2. https://github.com/aws/aws-sdk-java-v2 [Online; accessed 23. Nov. 2023]
[5]
2023. BlockHound. https://github.com/reactor/BlockHound [Online; accessed 31. Jul. 2023]
[6]
2023. Blocking call detected in io.lettuce.core.metrics.DefaultCommandLatencyCollector. https://github.com/lettuce-io/lettuce-core/issues/1513 [Online; accessed 27. Jul. 2023]
[7]
2023. Blocking code in reactive package ⋅ Issue #124 ⋅ eventuate-foundation/eventuate-common. https://github.com/eventuate-foundation/eventuate-common/issues/124 [Online; accessed 27. Jul. 2023]
[8]
2023. Blocking in WebSessionServerCsrfTokenRepository ⋅ Issue #8128 ⋅ spring-projects/spring-security. https://github.com/spring-projects/spring-security/issues/8128 [Online; accessed 27. Jul. 2023]
[9]
2023. CompilationUnit (javaparser-core 3.2.5 API). https://www.javadoc.io/doc/com.github.javaparser/javaparser-core/3.2.5/com/github/javaparser/ast/CompilationUnit.html [Online; accessed 19. Nov. 2023]
[10]
2023. CompletableFuture (Java Platform SE 8 ). https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/CompletableFuture.html##toCompletableFuture– [Online; accessed 1. Aug. 2023]
[11]
2023. CompletableFuture (Java Platform SE 8 ). https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/CompletableFuture.html##join– [Online; accessed 1. Aug. 2023]
[12]
2023. Doing blocking calls from DynamoDbEnhancedClientExtension methods. https://github.com/aws/aws-sdk-java-v2/issues/2996 [Online; accessed 27. Jul. 2023]
[13]
2023. Eclipse-Vertx/Vert.x. Eclipse Vert.x.
[14]
2023. How to Avoid Blocking Calls in Reactive Programming. https://bhavinshah7.medium.com/how-to-avoid-blocking-calls-in-reactive-programming-92a85c18866c [Online; accessed 15. Dec. 2023]
[15]
2023. "It’s a bug, not a featurequotedblright : A Proactive Approach to Repairing Blocking-call Bugs by Non-intrusive Patches. https://figshare.com/s/0b7e78405b0b86f6cbfb [Online; accessed 31. Jul. 2023]
[16]
2023. james-project. https://github.com/apache/james-project [Online; accessed 3. Dec. 2023]
[17]
2023. javaparser. https://github.com/javaparser/javaparser [Online; accessed 19. Nov. 2023]
[18]
2023. LexicalPreservingPrinter (javaparser-core 3.5.0 API). https://www.javadoc.io/doc/com.github.javaparser/javaparser-core/3.5.0/com/github/javaparser/printer/lexicalpreservation/LexicalPreservingPrinter.html [Online; accessed 19. Nov. 2023]
[19]
2023. Mono (reactor-core 3.5.8). https://projectreactor.io/docs/core/release/api/reactor/core/publisher/Mono.html##block– [Online; accessed 1. Aug. 2023]
[20]
2023. Move blocking mail items polling operation to boundedElastic. https://github.com/apache/james-project/pull/1650 [Online; accessed 15. Dec. 2023]
[21]
2023. nettosphere. https://github.com/Atmosphere/nettosphere [Online; accessed 12. Dec. 2023]
[22]
2023. Overview :: Spring Framework. https://docs.spring.io/spring-framework/reference/web/webflux/new-framework.html [Online; accessed 16. Dec. 2023]
[23]
2023. processor-health sample in chapter 13 blocks the I/O thread. https://github.com/cescoffier/reactive-systems-in-java/issues/230 [Online; accessed 27. Jul. 2023]
[24]
2023. Project Reactor. https://projectreactor.io/
[25]
2023. RxJava: Reactive Extensions for the JVM. https://github.com/ReactiveX/RxJava
[26]
2023. Schedulers (reactor-core 3.6.0). https://projectreactor.io/docs/core/release/api/reactor/core/scheduler/Schedulers.html [Online; accessed 18. Nov. 2023]
[27]
2023. spring-data-elasticsearch. https://github.com/spring-projects/spring-data-elasticsearch [Online; accessed 23. Nov. 2023]
[28]
2023. spring-data-examples. https://github.com/spring-projects/spring-data-examples [Online; accessed 12. Dec. 2023]
[29]
2023. spring-framework. https://github.com/spring-projects/spring-framework [Online; accessed 3. Dec. 2023]
[30]
2023. UUID.randomUUID() is detected as blocking, any replacement? ⋅ Issue #157 ⋅ reactor/BlockHound. https://github.com/reactor/BlockHound/issues/157 [Online; accessed 27. Jul. 2023]
[31]
2023. vertx-kafka-client. https://github.com/vert-x3/vertx-kafka-client [Online; accessed 3. Dec. 2023]
[32]
2023. vertx-micrometer-metrics. https://github.com/vert-x3/vertx-micrometer-metrics [Online; accessed 3. Dec. 2023]
[33]
2023. vertx-redis-client. https://github.com/vert-x3/vertx-redis-client [Online; accessed 3. Dec. 2023]
[34]
2023. vertx-redis-client. https://github.com/vert-x3/vertx-redis-client [Online; accessed 23. Nov. 2023]
[35]
2023. vertx-tracing. https://github.com/eclipse-vertx/vertx-tracing [Online; accessed 3. Dec. 2023]
[36]
2023. vertx-web. https://github.com/vert-x3/vertx-web [Online; accessed 23. Nov. 2023]
[37]
2023. VisualVM: Home. https://visualvm.github.io [Online; accessed 30. Jul. 2023]
[38]
2024. Android - what is Inappropriate blocking method call in Coroutine. https://stackoverflow.com/questions/73452001/android-what-is-inappropriate-blocking-method-call-in-coroutine [Online; accessed 4. Apr. 2024]
[39]
2024. Coroutine suspend function and blocking calls. https://stackoverflow.com/questions/60709511/coroutine-suspend-function-and-blocking-calls [Online; accessed 4. Apr. 2024]
[40]
2024. Coroutines basics ěrt Kotlin. https://kotlinlang.org/docs/coroutines-basics.html [Online; accessed 4. Apr. 2024]
[41]
2024. How to make ïnappropriate blocking method call" appropriate? https://stackoverflow.com/questions/58680028/how-to-make-inappropriate-blocking-method-call-appropriate [Online; accessed 4. Apr. 2024]
[42]
2024. How to replace blocking code for reading bytes in Kotlin. https://stackoverflow.com/questions/56533497/how-to-replace-blocking-code-for-reading-bytes-in-kotlin [Online; accessed 4. Apr. 2024]
[43]
2024. How to use a Kotlin coroutine to call a blocking function? https://stackoverflow.com/questions/64306381/how-to-use-a-kotlin-coroutine-to-call-a-blocking-function [Online; accessed 4. Apr. 2024]
[44]
2024. import file: handle when the storage is in fact a network one by vmiklos ⋅ Pull Request #420 ⋅ vmiklos/plees-tracker. https://github.com/vmiklos/plees-tracker/pull/420 [Online; accessed 4. Apr. 2024]
[45]
2024. Inappropriate blocking method call ⋅ Issue #10 ⋅ aseemsavio/IntelligentPiCamera. https://github.com/aseemsavio/IntelligentPiCamera/issues/10 [Online; accessed 4. Apr. 2024]
[46]
2024. mercury. https://github.com/Accenture/mercury [Online; accessed 24. Mar. 2024]
[47]
2024. Moshi: how to fix "Inappropriate blocking method call" warning in the coroutine? https://stackoverflow.com/questions/73343117/moshi-how-to-fix-inappropriate-blocking-method-call-warning-in-the-coroutine [Online; accessed 4. Apr. 2024]
[48]
2024. plees-tracker. https://github.com/vmiklos/plees-tracker [Online; accessed 4. Apr. 2024]
[49]
2024. reactive-streams-jvm. https://github.com/reactive-streams/reactive-streams-jvm [Online; accessed 4. Apr. 2024]
[50]
2024. reactor-core. https://github.com/reactor/reactor-core [Online; accessed 4. Apr. 2024]
[51]
2024. smallrye-mutiny. https://github.com/smallrye/smallrye-mutiny [Online; accessed 4. Apr. 2024]
[52]
2024. Some feedback ⋅ Issue #1 ⋅ srrollin/weather. https://github.com/srrollin/weather/issues/1 [Online; accessed 4. Apr. 2024]
[53]
2024. spring-reactive-sample. https://github.com/hantsy/spring-reactive-sample [Online; accessed 24. Mar. 2024]
[54]
2024. vertx-micrometer-metrics. https://github.com/vert-x3/vertx-micrometer-metrics [Online; accessed 24. Mar. 2024]
[55]
2024. what reason show message that "Possibly blocking call in non-blocking context could lead to thread starvation"? https://stackoverflow.com/questions/73252926/what-reason-show-message-that-possibly-blocking-call-in-non-blocking-context-co [Online; accessed 4. Apr. 2024]
[56]
Manuel Alabor and Markus Stolze. 2020. Debugging of RxJS-based applications. In REBLS 2020: Proceedings of the 7th ACM SIGPLAN International Workshop on Reactive and Event-Based Languages and Systems. Association for Computing Machinery, New York, NY, USA. 15–24. isbn:978-1-45038188-8 https://doi.org/10.1145/3427763.3428313
[57]
Herman Banken, Erik Meijer, and Georgios Gousios. 2018. Debugging data flows in reactive programs. In ICSE ’18: Proceedings of the 40th International Conference on Software Engineering. Association for Computing Machinery, New York, NY, USA. 752–763. isbn:978-1-45035638-1 https://doi.org/10.1145/3180155.3180156
[58]
G. A. BARNARD. 1947. SIGNIFICANCE TESTS FOR 2×2 TABLES. Biometrika, 34, 1-2 (1947), 01, 123–138. issn:0006-3444 https://doi.org/10.1093/biomet/34.1-2.123
[59]
D. Beronić, P. Pufek, B. Mihaljević, and A. Radovan. 2021. On Analyzing Virtual Threads – a Structured Concurrency Model for Scalable Applications on the JVM. In 2021 44th International Convention on Information, Communication and Electronic Technology (MIPRO). IEEE, 1684–1689. issn:2623-8764 https://doi.org/10.23919/MIPRO52101.2021.9596855
[60]
Felix Dobslaw, Morgan Vallin, and Robin Sundström. 2020. Free the Bugs: Disclosing Blocking Violations in Reactive Programming. In 2020 IEEE 20th International Working Conference on Source Code Analysis and Manipulation (SCAM). IEEE, 177–186. issn:2470-6892 https://doi.org/10.1109/SCAM51674.2020.00025
[61]
Vladimir Filipchenko. 2023. An Intro to Spring WebFlux Threading Model. https://hackernoon.com/an-intro-to-spring-webflux-threading-model [Online; accessed 27. Jul. 2023]
[62]
Satyajit Gokhale, Alexi Turcotte, and Frank Tip. 2021. Automatic migration from synchronous to asynchronous JavaScript APIs. Proc. ACM Program. Lang., 5, OOPSLA (2021), Article 160, oct, 27 pages. https://doi.org/10.1145/3485537
[63]
David Harel, Guy Katz, Assaf Marron, and Gera Weiss. 2012. Non-Intrusive Repair of Reactive Programs. In 2012 IEEE 17th International Conference on Engineering of Complex Computer Systems. 3–12. https://doi.org/10.1109/ICECCS20050.2012.6299199
[64]
Vincent J. Hellendoorn, Premkumar T. Devanbu, and Alberto Bacchelli. [n. d.]. Will They Like This? Evaluating Code Contributions with Language Models. In 2015 IEEE/ACM 12th Working Conference on Mining Software Repositories. IEEE, 16–17. isbn:978-0-7695-5594-2 https://doi.org/10.1109/MSR.2015.22
[65]
Jiajun Jiang, Yingfei Xiong, Hongyu Zhang, Qing Gao, and Xiangqun Chen. 2018. Shaping Program Repair Space with Existing Patches and Similar Code. In ISSTA 2018: Proceedings of the 27th ACM SIGSOFT International Symposium on Software Testing and Analysis (ISSTA 2018). Association for Computing Machinery, New York, NY, USA. 298–309. isbn:9781450356992 https://doi.org/10.1145/3213846.3213871
[66]
Dongsun Kim, Jaechang Nam, Jaewoo Song, and Sunghun Kim. 2013. Automatic patch generation learned from human-written patches. In 2013 35th International Conference on Software Engineering (ICSE). IEEE, San Francisco, CA, USA. 802–811. https://doi.org/10.1109/ICSE.2013.6606626
[67]
Sirojiddin Komolov, Nursultan Askarbekuly, and Manuel Mazzara. 2020. An empirical study of multi-threading paradigms Reactive programming vs continuation-passing style. In ICCBD ’20: 2020 the 3rd International Conference on Computing and Big Data. Association for Computing Machinery, New York, NY, USA. 37–41. isbn:978-1-45038786-6 https://doi.org/10.1145/3418688.3418695
[68]
Mirko Köhler and Guido Salvaneschi. 2019. Automated Refactoring to Reactive Programming. In 2019 34th IEEE/ACM International Conference on Automated Software Engineering (ASE). IEEE, 835–846. issn:2643-1572 https://doi.org/10.1109/ASE.2019.00082
[69]
Anil Koyuncu, Kui Liu, Tegawendé F. Bissyandé, Dongsun Kim, Jacques Klein, Martin Monperrus, and Yves Le Traon. 2020. FixMiner: Mining Relevant Fix Patterns for Automated Program Repair. Empirical Softw. Engg., 25, 3 (2020), may, 1980–2024. issn:1382-3256 https://doi.org/10.1007/s10664-019-09780-z
[70]
K. Liu, D. Kim, T. F. Bissyandé, S. Yoo, and Y. Le Traon. 2021. Mining Fix Patterns for FindBugs Violations. IEEE Transactions on Software Engineering, 47, 1 (2021), Jan., 165–188. https://doi.org/10.1109/TSE.2018.2884955
[71]
K. Liu, A. Koyuncu, D. Kim, and T. F. Bissyande. 2019. AVATAR: Fixing Semantic Bugs with Fix Patterns of Static Analysis Violations. In 2019 IEEE 26th International Conference on Software Analysis, Evolution and Reengineering (SANER). IEEE Computer Society, Los Alamitos, CA, USA. 1–12. issn:1534-5351 https://doi.org/10.1109/SANER.2019.8667970
[72]
Kui Liu, Anil Koyuncu, Dongsun Kim, and Tegawendé F. Bissyandé. 2019. TBar: Revisiting Template-Based Automated Program Repair. In ISSTA 2019: Proceedings of the 28th ACM SIGSOFT International Symposium on Software Testing and Analysis (ISSTA 2019). Association for Computing Machinery, New York, NY, USA. 31–42. isbn:9781450362245 https://doi.org/10.1145/3293882.3330577
[73]
Xuliang Liu and Hao Zhong. 2018. Mining stackoverflow for program repair. In 2018 IEEE 25th International Conference on Software Analysis, Evolution and Reengineering (SANER). IEEE, Campobasso, Italy. 118–129. https://doi.org/10.1109/SANER.2018.8330202
[74]
Mark. 2020. Experimenting with Project Loom EAP and Spring WebMVC. Paluch, Sept., https://paluch.biz/blog/182-experimenting-with-project-loom-eap-and-spring-webmvc.html
[75]
Oliver Moseler, Lucas Kreber, and Stephan Diehl. 2022. The ThreadRadar visualization for debugging concurrent Java programs. J. Visualization, 25, 6 (2022), Dec., 1267–1289. issn:1875-8975 https://doi.org/10.1007/s12650-022-00843-w
[76]
Arthur Navarro, Julien Ponge, Frédéric Le Mouël, and Clément Escoffier. 2023. Considerations for integrating virtual threads in a Java framework: a Quarkus example in a resource-constrained environment. https://doi.org/10.1145/3583678.3596895 [Online; accessed 30. Jul. 2023]
[77]
Adrian Nistor, Po-Chun Chang, Cosmin Radoi, and Shan Lu. 2015. Caramel: Detecting and Fixing Performance Problems That Have Non-intrusive Fixes. In Proceedings of the 37th International Conference on Software Engineering - Volume 1 (ICSE ’15). IEEE Press, Piscataway, NJ, USA. 902–912.
[78]
Tomasz Nurkiewicz. 2022. Project Loom: Revolution in Java Concurrency or Obscure Implementation Detail? InfoQ, Oct., https://www.infoq.com/presentations/loom-java-concurrency
[79]
Frolin S. Ocariza, Jr., Karthik Pattabiraman, and Ali Mesbah. 2014. Vejovis: Suggesting Fixes for JavaScript Faults. In Proceedings of the 36th International Conference on Software Engineering (ICSE 2014). Association for Computing Machinery, New York, NY, USA. 837–847. isbn:9781450327565 https://doi.org/10.1145/2568225.2568257
[80]
Indigo Orton and Alan Mycroft. 2021. Refactoring traces to identify concurrency improvements. In FTfJP ’21: Proceedings of the 23rd ACM International Workshop on Formal Techniques for Java-like Programs. Association for Computing Machinery, New York, NY, USA. 16–23. isbn:978-1-45038543-5 https://doi.org/10.1145/3464971.3468420
[81]
Jevgenija Pantiuchina, Fiorella Zampetti, Simone Scalabrino, Valentina Piantadosi, Rocco Oliveto, Gabriele Bavota, and Massimiliano Di Penta. 2020. Why Developers Refactor Source Code: A Mining-based Study. ACM Trans. Software Eng. Method., 29, 4 (2020), Sept., 1–30. issn:1049-331X https://doi.org/10.1145/3408302
[82]
Gaetano Piazzolla. 2023. Java Virtual Threads - Dev Genius. Medium, Jan., https://blog.devgenius.io/java-virtual-threads-715c162c6c39
[83]
Julien Ponge, Arthur Navarro, Clément Escoffier, and Frédéric Le Mouël. 2021. Analysing the performance and costs of reactive programming libraries in Java. In REBLS 2021: Proceedings of the 8th ACM SIGPLAN International Workshop on Reactive and Event-Based Languages and Systems. Association for Computing Machinery, New York, NY, USA. 51–60. isbn:978-1-45039108-5 https://doi.org/10.1145/3486605.3486788
[84]
Arooba Shahoor, Askar Khamit, Jooyong Yi, and Dongsun Kim. 2023. LeakPair: Proactive Repairing of Memory Leaks in Single Page Web Applications. In Proceedings of the 38th IEEE/ACM International Conference on Automated Software Engineering.
[85]
Alexi Turcotte, Michael D. Shah, Mark W. Aldrich, and Frank Tip. 2022. DrAsync: Identifying and Visualizing Anti-Patterns in Asynchronous JavaScript. In 2022 IEEE/ACM 44th International Conference on Software Engineering (ICSE). 774–785. https://doi.org/10.1145/3510003.3510097
[86]
Zan Wang, Dongdi Zhang, Shuang Liu, Jun Sun, and Yingquan Zhao. [n. d.]. Adaptive Randomized Scheduling for Concurrency Bug Detection. In 2019 24th International Conference on Engineering of Complex Computer Systems (ICECCS). IEEE, 10–13. https://doi.org/10.1109/ICECCS.2019.00021
[87]
Westley Weimer, ThanhVu Nguyen, Claire Le Goues, and Stephanie Forrest. 2009. Automatically Finding Patches Using Genetic Programming. In Proceedings of the 31st International Conference on Software Engineering (ICSE ’09). IEEE Computer Society, 364–374. https://doi.org/10.1109/ICSE.2009.5070536
[88]
Ming Wen, Junjie Chen, Rongxin Wu, Dan Hao, and Shing-Chi Cheung. 2018. Context-Aware Patch Generation for Better Automated Program Repair. In Proceedings of the 40th International Conference on Software Engineering (ICSE ’18). ACM, New York, NY, USA. 1–11. https://doi.org/10.1145/3180155.3180233
[89]
Carlos Zimmerle, Kiev Gama, Fernando Castor, and José Murilo Mota Filho. [n. d.]. Mining the Usage of Reactive Programming APIs: A Study on GitHub and Stack Overflow. In 2022 IEEE/ACM 19th International Conference on Mining Software Repositories (MSR). IEEE, 23–24. https://doi.org/10.1145/3524842.3527966
[90]
Carlos Zimmerle, Kiev Gama, Fernando Castor, and José Murilo Mota Filho. 2022. Mining the usage of reactive programming APIs: a study on GitHub and stack overflow. In MSR ’22: Proceedings of the 19th International Conference on Mining Software Repositories. Association for Computing Machinery, New York, NY, USA. 203–214. isbn:978-1-45039303-4 https://doi.org/10.1145/3524842.3527966

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
ISSTA 2024: Proceedings of the 33rd ACM SIGSOFT International Symposium on Software Testing and Analysis
September 2024
1928 pages
ISBN:9798400706127
DOI:10.1145/3650212
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 11 September 2024

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. blocking calls
  2. non-intrusive patches
  3. proactive debugging
  4. program repair
  5. reactive programming

Qualifiers

  • Research-article

Funding Sources

  • National Research Foundation of Korea
  • Institute for Information & Communications Technology Planning & Evaluation

Conference

ISSTA '24
Sponsor:

Acceptance Rates

Overall Acceptance Rate 58 of 213 submissions, 27%

Upcoming Conference

ISSTA '25

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • 0
    Total Citations
  • 109
    Total Downloads
  • Downloads (Last 12 months)109
  • Downloads (Last 6 weeks)27
Reflects downloads up to 16 Feb 2025

Other Metrics

Citations

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media