Posts Tagged ‘Criteo’
[DevoxxFR2026] Production Troubleshooting: Enhancing Diagnostic Skills Through a Real-World Case Study
Lecturer
William Montaz is a technical leader at Criteo, where he tackles complex production issues in large-scale distributed systems. With extensive experience in machine learning infrastructure and data pipelines, he emphasizes methodical investigation techniques and cognitive bias awareness in high-stakes debugging scenarios.
Abstract
Critical incidents trigger immediate pressure: inconsistent data, unpredictable behaviors, and alarmed stakeholders. The instinctive response often involves blaming the most recent change or following intuition, frequently without meaningful progress. William Montaz guides participants through a genuine technical investigation where Apache Spark serves merely as context for a deeper exploration of methodology. The session demonstrates constructing systematic inquiries in unfamiliar territory, avoiding confirmation bias, breaking down obscure problems into testable hypotheses, and distinguishing correlation from causation. Through this concrete case of corrupted Spark job outputs during a datacenter migration, attendees learn practical skills for effective production troubleshooting.
The High-Stakes Nature of Production Incidents
Production environments demand rapid, accurate diagnosis under intense pressure. When jobs begin producing corrupted data—duplicate rows alongside missing entries—stakeholders naturally seek quick explanations. The temptation to attribute issues to recent changes or visible symptoms often leads investigations astray. Effective troubleshooting requires disciplined methodology rather than reactive speculation.
In large-scale data platforms like Criteo’s, where millions of containers process petabytes daily, incidents can cascade rapidly. Understanding both technical details and cognitive pitfalls becomes essential for resolution.
MapReduce and Spark: Foundational Concepts for the Investigation
To appreciate the case, familiarity with core distributed processing concepts proves valuable. MapReduce provides a framework for parallel computation across large datasets. The classic word count example illustrates the pattern: a map phase extracts key-value pairs (words as keys, counts as values), followed by shuffling to group related keys, and a reduce phase aggregates results.
Spark builds upon these principles with optimizations for iterative processing and in-memory computation. Jobs compile into directed acyclic graphs (DAGs) of stages, where each stage typically ends with a shuffle operation. This architecture enables fault tolerance through recomputation of failed tasks but introduces complexities around data consistency during retries.
Understanding these mechanics helps frame hypotheses about potential failure modes in distributed environments.
The Incident: Corrupted Data During Datacenter Migration
The reported issue involved Spark jobs producing inconsistent outputs with both missing and duplicated rows. The problem appeared intermittently, resolving after multiple retries. Context proved crucial: the organization was migrating its massive compute infrastructure between datacenters under tight timelines.
Initial observations suggested possible connections to the migration. Data replication across sites introduced network latency and potential consistency challenges. However, jumping to conclusions risked confirmation bias. Multiple hypotheses required systematic evaluation.
One theory posited replication inconsistencies between datacenters causing read anomalies. Another focused on increased disk pressure from migration activities leading to timeouts in shuffle operations. A third examined custom components like Kyuubi and AQ used for performance optimizations in the final job stages.
Systematic Investigation: Avoiding Cognitive Biases
Effective diagnosis demands awareness of common cognitive traps. The availability heuristic might overemphasize recent migration activities. Authority bias could discourage questioning framework behavior. Confirmation bias risks pursuing convenient explanations while ignoring contradictory evidence.
The investigation proceeded by gathering concrete data rather than speculating. Reproduction attempts in controlled environments revealed patterns: corruption occurred specifically during partial recomputes of the final stage under certain timing conditions. This narrowed focus to repartition operations and shuffle mechanics.
Code examination and instrumentation provided further clarity. Custom logging and Redis-based tracking of hash codes during repartitioning exposed non-deterministic behavior in floating-point aggregations. Order-dependent summation of floats, combined with retry mechanisms, produced the observed duplicates and omissions.
Root Cause Analysis and Resolution
The true cause emerged from careful observation of Spark’s internal repartition logic. Non-deterministic shuffle ordering during retries, combined with floating-point summation sensitivities, created inconsistent aggregations. The system assumed deterministic behavior across recomputations, an assumption violated under failure conditions.
Resolution involved enforcing deterministic partitioning and explicit sorting before aggregations. This fix eliminated the corruption while maintaining performance characteristics.
The case highlights that symptoms (duplicates, missing rows) traced back through multiple layers: migration pressure, shuffle timeouts, retry mechanics, and subtle numerical properties. Premature conclusions would have missed this chain.
Key Lessons for Production Troubleshooting
Several principles emerge from this investigation. Avoid premature extrapolation and maintain intellectual humility regarding framework perfection. Actively seek disconfirming evidence rather than supporting data. Leverage general knowledge and orders of magnitude to identify anomalies. Reading source code, when accessible, provides invaluable insights.
Presenting partial findings to colleagues surfaces blind spots and strengthens reasoning. Treat production systems with appropriate respect for their complexity while systematically eliminating hypotheses.
These approaches scale beyond Spark to any distributed system. They transform troubleshooting from art to disciplined practice.
Conclusion
Production incidents test both technical knowledge and cognitive discipline. By following methodical investigation practices, acknowledging biases, and pursuing root causes through evidence rather than assumption, teams can resolve complex issues effectively. The Spark corruption case during datacenter migration exemplifies how apparent framework problems often trace to subtle interactions requiring patient, thorough analysis. These skills prove invaluable for maintaining reliable large-scale systems.
Links:
[DevoxxGR2024] Meet Your New AI Best Friend: LangChain at Devoxx Greece 2024 by Henry Lagarde
At Devoxx Greece 2024, Henry Lagarde, a senior software engineer at Criteo, introduced audiences to LangChain, a versatile framework for building AI-powered applications. With infectious enthusiasm and live demonstrations, Henry showcased how LangChain simplifies interactions with large language models (LLMs), enabling developers to create context-aware, reasoning-driven tools. His talk, rooted in his experience at Criteo, a leader in retargeting and retail media, highlighted LangChain’s composability and community-driven evolution, offering a practical guide for AI integration.
LangChain’s Ecosystem and Composability
Henry began by defining LangChain as a framework for building context-aware reasoning applications. Unlike traditional LLM integrations, LangChain provides modular components—prompt templates, LLM abstractions, vector stores, text splitters, and document loaders—that integrate with external services rather than hosting them. This composability allows developers to switch LLMs seamlessly, adapting to changes in cost or performance without rewriting code. Henry emphasized LangChain’s open-source roots, launched in late 2022, and its rapid growth, with versions in Python, TypeScript, Java, and more, earning it the 2023 New Tool of the Year award.
The ecosystem extends beyond core modules to include LangServe for REST API deployment, LangSmith for monitoring, and a community hub for sharing prompts and agents. This holistic approach supports developers from prototyping to production, making LangChain a cornerstone for AI engineering.
Building a Chat Application
In a live demo, Henry showcased LangChain’s simplicity by recreating a ChatGPT-like application in under 10 lines of Python code. He instantiated an OpenAI client using GPT-3.5 Turbo, implemented chat history for context awareness, and used prompt templates to define system and human messages. By combining these components, he enabled streaming responses, mimicking ChatGPT’s real-time output without the $20 monthly subscription. This demonstration highlighted LangChain’s ability to handle memory, input/output formatting, and LLM interactions with minimal effort, empowering developers to build cost-effective alternatives.
Henry noted that LangChain’s abstractions, such as strong typing and output parsing, eliminate manual prompt engineering, ensuring robust integrations even when APIs change. The demo underscored the framework’s accessibility, inviting developers to experiment with its capabilities.
Creating an AI Agent for PowerPoint Generation
Henry’s second demo illustrated LangChain’s advanced features by building an AI agent to generate PowerPoint presentations. Using TypeScript, he configured a system prompt from LangSmith’s community hub, defining the agent’s tasks: researching a topic via the Serper API and generating a structured PowerPoint. He defined tools with Zod for runtime type checking, ensuring consistent outputs, and integrated callbacks for UI tracing and monitoring.
The agent, powered by Anthropic’s Claude model, performed internet research on Google Cloud, compiled findings, and generated a presentation with sourced information. Despite minor delays, the demo showcased LangChain’s ability to orchestrate complex workflows, combining research, data processing, and content creation. Henry’s use of LangSmith for prompt optimization and monitoring highlighted the framework’s production-ready capabilities.
Community and Cautions
Henry emphasized LangChain’s vibrant community, which drives its multi-language support and rapid evolution. He encouraged attendees to contribute, noting the framework’s open-source ethos and resources like GitHub for further exploration. However, he cautioned against over-reliance on LLMs, citing their occasional laziness or errors, as seen in ChatGPT’s simplistic responses. LangChain, he argued, augments developer workflows but requires careful integration to ensure reliability in production environments.
His vision for LangChain is one of empowerment, enabling developers to enhance applications incrementally while maintaining control over AI-driven processes. By sharing his demo code on GitHub, Henry invited attendees to experiment and contribute to LangChain’s growth.
Conclusion
Henry’s presentation at Devoxx Greece 2024 was a compelling introduction to LangChain’s potential. Through practical demos and insightful commentary, he demonstrated how the framework simplifies AI development, from basic chat applications to sophisticated agents. His emphasis on composability, community, and cautious integration resonated with developers eager to explore AI. As LangChain continues to evolve, Henry’s talk serves as a blueprint for harnessing its capabilities in real-world applications.